MICLab-Unicamp / e2dhipseg

This contains official implementation for Extended 2D Volumetric Consensus Hippocampus Segmentation
Other
19 stars 6 forks source link

FileNotFoundError: No such file or no access: 'final_buffer.nii.gz' #1

Closed whui03 closed 4 years ago

whui03 commented 5 years ago

When I tried run this : python3 run.py , error occurred, could you please help me?

Finished segmentation in 125.25966596603394s Inverting matrix... cache/mask.nii.gz terminate called after throwing an instance of 'NEWMAT::SingularException' Transforming back to original space... Could not open matrix file cache/invmnibuffer.mat terminate called after throwing an instance of 'NEWMAT::IncompatibleDimensionsException' Traceback (most recent call last): File "/home/w/anaconda3/envs/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 40, in load stat_result = os.stat(filename) FileNotFoundError: [Errno 2] No such file or directory: 'final_buffer.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 235, in main mask_path = invert_matrix(TEMP_MASK_PATH, volpath, MNI_BUFFER_MATRIX_PATH) File "run.py", line 132, in invert_matrix save_path = ref_path + "_voxelcount-{}_e2dhipmask.nii.gz".format(int(nib.load("final_buffer.nii.gz").get_fdata().sum())) File "/home/w/anaconda3/envs/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: 'final_buffer.nii.gz'

dscarmo commented 5 years ago

Hello! Could you confirm FLIRT is working on your machine?

This error is related to MNI152 registration.

Try to run without the -reg argument, e. g.: python3 run.py path/to/volume.nii.gz

or without performing MNI152 registration when using the graphical interface (there will be a window asking if you want to, say no).

whui03 commented 5 years ago

@dscarmo Thank you! Maybe FLIRT can't work . I tried run without the -reg argument. Then segmentation finished. I will try to reinstall FLIRT.

whui03 commented 5 years ago

@dscarmo Hi, the result is left and right hippocampus, so how to caculate the Dice coefficient? I tried crop left hippocampus from the result . but the img matrix is [0 0 0.........] .

dscarmo commented 5 years ago

In this version, the model is not separating between left and right hippocampus. The resulting mask should have both hippocampus, with the same label (1).

dscarmo commented 4 years ago

Im closing this due to inactivity, feel free to report any more issues!

Final version of the model is coming December, with a lot of improvements!

dscarmo commented 4 years ago

@whui03 , we found that this results with a fully zeroes matrix [0 0 0 0 ...] can be caused by your volume being in a different orientation than expected, since you weren't able to use the -reg argument.

We are going to update this repo in December with a fix to this issue, but currently, please check if you flirt installation is working (test flirt commands on terminal). Any more problems im here to help!