dama-lab / multi-atlas-segmentation

Multi Atlas Segmentation and Morphometric analysis toolkit (MASMAT) for mouse brain MRI
https://github.com/dancebean/multi-atlas-segmentation/blob/master/README.md
MIT License
34 stars 9 forks source link

`mas_masking_batch` fails to find headers #3

Open Hierakonpolis opened 4 years ago

Hierakonpolis commented 4 years ago

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):

Hierakonpolis commented 4 years ago

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)

bramcal commented 4 years ago

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

Hierakonpolis commented 4 years ago

No

27rg5 commented 1 year ago

Could anyone solve this issue in recent times?