Some problem when running ilastik fix(KeyError: 'Patient1_s0_a1_ac_ilastik_x593_y590_w500_h500')
Dear Sirs, Thank you for developing steinbock,which is a wonderful package used for IMC image processing. However,when trying to run your sample program: ` steinbock classify ilastik prepare --cropsize 500 --seed 123
rm pixel_classifier.ilp && mv IMCWorkflow.ilp pixel_classifier.ilp
rm -r ilastik_crops && mv analysis/crops ilastik_crops
steinbock classify ilastik fix --no-backup
I met the following problem: Traceback (most recent call last):
File "D:\python\IMCprocess\imc_classification_cmd.py", line 45, in
I've read your source code and found that you implemented the function as follows: ` ilastik_crop_shapes = {}
last_transpose_axes = None
for (
ilastik_crop_file,
transpose_axes,
ilastik_crop,
) in ilastik.try_fix_ilastik_crops_from_disk(
ilastik_crop_files, orig_axis_order=orig_axis_order
):
if last_transpose_axes not in (None, transpose_axes):
raise SteinbockCLIException("Inconsistent axis orders across crops")
ilastik.write_ilastik_crop(ilastik_crop, ilastik_crop_file)
ilastik_crop_shapes[ilastik_crop_file.stem] = ilastik_crop.shape
last_transpose_axes = transpose_axes
logger.info(ilastik_crop_file)
del ilastik_crop
ilastik.fix_ilastik_project_file_inplace(
ilastik_project_file,
ilastik_crop_dir,
ilastik_probab_dir,
ilastik_crop_shapes,
last_transpose_axes,
)`
However,the ilastik.try_fix_ilastik_crops_from_disk function returns noting (because it always continue in the loop) when "steinbock" is True in the dataset,and the ilastik_crop_shape keeps an empty dict.Therefore,when the program runs into the fix_ilastik_project_file_inplace function ,it might occur an error in the following part because the ilastik_crop_shapes contains nothing: ` _fix_raw_data_group_inplace(
raw_data_group,
file_path=str(
rel_ilastik_crop_dir
/ ilastik_crop_file.name
/ _crop_dataset_path
),
nickname=ilastik_crop_file.stem,
shape=ilastik_crop_shapes[ilastik_crop_file.stem],
)`
I wonder whether I use the function wrongly or there might be some problem with the code. Thanks a lot!!!