multi-atlas-segmentation icon indicating copy to clipboard operation
multi-atlas-segmentation copied to clipboard

`mas_masking_batch` fails to find headers

Open Hierakonpolis opened this issue 4 years ago • 4 comments

Describe the bug mas_masking_batch fails to find the header of the *.affine.nii.gz files. The files can be visualized correctly in fsleyes and I can access the header when opened in python using nibabel.

I did not encounter this problem when testing the same script on one of the atlas files, but it fails on my MRI volumes. While I understand there might be something wrong with my data, it would be very helpful if the script would raise a more informative error and tell me what the problem is. I tried tweaking the header, even replacing it entirely with the header from one of the template volumes (while keeping dim, pixdim, srow_* and affine matrix data), with no changes.


 [mas_masking_batch] run label fusion locally for target: O.nii.gz ... 

target_dir=/media/Olowoo/theoldstuff/DMM
target_id=O.nii.gz
result_dir=/media/Olowoo/theoldstuff/test
atlas_dir=/media/Olowoo/validation/atlases
atlas_name=atlases
[mas_masking_fusion] prepare 4D mask file /media/Olowoo/theoldstuff/test/mask/atlases/O.nii.gz.4D.nii.gz for label fusion ...
** ERROR (nifti_image_read): failed to find header file for '/media/Olowoo/theoldstuff/test/mask/atlases/O.nii.gz.mask.A0.affine.nii.gz'
* Error when reading the input image
[check_image_file] cannot find file (/media/Olowoo/theoldstuff/test/mask/O.nii.gz.mask.atlases.nii.gz)

 [mas_masking_fusion] fuse mapped mask from atlases for O.nii.gz
** ERROR (nifti_image_read): failed to find header file for '/media/Olowoo/theoldstuff/test/mask/atlases/O.nii.gz.4D.nii.gz'
* Error when reading the Label image: /media/Olowoo/theoldstuff/test/mask/atlases/O.nii.gz.4D.nii.gz
[check_image_file] cannot find file (/media/Olowoo/theoldstuff/test/mask/O.nii.gz.mask.atlases.nii.gz)
[mas_masking_fusion] (O.nii.gz) failed to generate mask file: /media/Olowoo/theoldstuff/test/mask/O.nii.gz.mask.atlases.nii.gz, skip quickcheck ...

Desktop (please complete the following information):

  • OS: Linux Mint 19.3 Cinnamon

Hierakonpolis avatar Jul 02 '20 23:07 Hierakonpolis

It appears the names of the files generated (O.mask.A0.affine.nii.gz) do not match with the names of the files the algorithm is looking for (O.nii.gz.mask.A0.affine.nii.gz)

Hierakonpolis avatar Jul 03 '20 09:07 Hierakonpolis

I have the same problem. Were you able to solve it?

bramcal avatar Aug 13 '20 16:08 bramcal

No

Hierakonpolis avatar Aug 23 '20 18:08 Hierakonpolis