Skip to content

Problem encountered when skipping N4 #20

@lundq163

Description

@lundq163

Describe the bug
When setting --N4 to False when running the container, an intermediate file is not getting produced which appears to result in a downstream error.

Expected behavior
The error results from -reorient-enhanced.nii.gz intermediate in particular not being produced. In previous tests with the --N4 arg set as default, this error did not occur.

Screenshots
Error Log:

WARNING: In /tmp/SimpleITK-build/ITK/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx, line 1053
NiftiImageIO (0x557274a180f0): ./Template/template.hdr is Analyze file and it's deprecated 

WARNING: In /tmp/SimpleITK-build/ITK/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx, line 1053
NiftiImageIO (0x557274a180f0): ./Template/template.hdr is Analyze file and it's deprecated 

/utils/utils.py:209: UserWarning: Any labeled images will be returned as a boolean array. Did you mean to use a boolean array?
  filled_mask = remove_small_holes(mask, area_threshold=area_threshold)
Traceback (most recent call last):
  File "/BME-X.py", line 355, in <module>
    main()
  File "/BME-X.py", line 305, in main
    enhanced_img = sitk.ReadImage(enhanced_path)
  File "/usr/local/lib/python3.8/site-packages/SimpleITK/extra.py", line 384, in ReadImage
    return reader.Execute()
  File "/usr/local/lib/python3.8/site-packages/SimpleITK/SimpleITK.py", line 8502, in Execute
    return _SimpleITK.ImageFileReader_Execute(self)
RuntimeError: Exception thrown in SimpleITK ImageFileReader_Execute: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:91:
sitk::ERROR: The file "/app/data/test/sub-106525/ses-V03/anat/sub-106525_ses-V03_run-2_T1w-reorient-enhanced.nii.gz" does not exist.

Output Log:

Found 1 files for subject 106525 and session V03
Subject ID: 106525
Session ID: V03
Processing file: /app/data/test/sub-106525/ses-V03/anat/sub-106525_ses-V03_run-2_T1w.nii.gz
Reorient to RAI direction
Skip N4
Downsample to 1.6*1.6*1.6
Histogram matching
Skull stripping
Upsample to original space
Save brainmask
age_unit: years
sessions_tsv_age: /app/data/test/sub-106525/sub-106525_sessions.tsv 6
age_in_month 6
file_path_for_BMEX /app/data/test/sub-106525/ses-V03/anat
Model:  ./BME_X/checkpoints/BMEX-Month6-T1-model.pt
Reference image: Template-Month6-T1w.nii.gz

Desktop (please complete the following information):

  • OS: Linux
  • Run Command: /usr/bin/singularity exec --pwd / -B ${data_dir}:/app/data /home/faird/shared/projects/BME-X/code/bme-x_v1.0.3.sif python /BME-X.py --pretrained_dir /Model --subject_id ${subj_id} --session_id ${ses_id} --bids_root test --roi_x 64 --roi_y 64 --roi_z 64 --N4 False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions