freesurfer / freesurfer

Neuroimaging analysis and visualization suite
Other
580 stars 243 forks source link

mri_normalize: "No such file or directory" by MRInormFindControlPoints #822

Closed 0rC0 closed 3 years ago

0rC0 commented 3 years ago

Platform details:

Summary

During recon1, during mri_normalize, No such file or directory is returned. The T1w looks good, no artifacts or defects are visible.

The building Voronoi diagram..., takes almost no time, while normally it takes a few tens of seconds. The problem should be somewhere near that step.

Bug already reported in mailing list last June 8th, without solution.

Actual behavior

mri_normalize -g 1 -seed 1234 -mprage -noconform nu.mgz T1.mgz 
using max gradient = 1.000
setting seed for random number genererator to 1234
assuming input volume is MGH (Van der Kouwe) MP-RAGE
not interpolating and embedding volume to be 256^3...
reading mri_src from nu.mgz...
normalizing image...
processing without aseg, no1d=0
MRInormInit(): 
talairach transform
 1.25091   0.06422   0.08536   3.34021;
-0.06613   1.16311   0.13986  -38.63994;
-0.07078  -0.24160   1.26733   29.54118;
 0.00000   0.00000   0.00000   1.00000;
INFO: Modifying talairach volume c_(r,a,s) based on average_305
MRInormalize(): 
MRIsplineNormalize(): npeaks = 11
Starting OpenSpline(): npoints = 11
building Voronoi diagram...
performing soap bubble smoothing, sigma = 8...

Iterating 2 times
---------------------------------
3d normalization pass 1 of 2
error: No such file or directory
error: MRInormFindControlPoints: could not find enough control points
error: No such file or directory
error: MRInormFindControlPoints failed

Expected behavior

mri_normalize -g 1 -seed 1234 -mprage -noconform nu_097.mgz T1.mgz
using max gradient = 1.000
setting seed for random number genererator to 1234
assuming input volume is MGH (Van der Kouwe) MP-RAGE
not interpolating and embedding volume to be 256^3...
reading mri_src from nu_097.mgz...
normalizing image...
processing without aseg, no1d=0
MRInormInit(): 
talairach transform
 1.23396   0.06985   0.00686   1.01376;
-0.05509   1.18110   0.38500  -22.98849;
 0.04544  -0.47629   1.29074   51.27541;
 0.00000   0.00000   0.00000   1.00000;
INFO: Modifying talairach volume c_(r,a,s) based on average_305
MRInormalize(): 
MRIsplineNormalize(): npeaks = 16
Starting OpenSpline(): npoints = 16
building Voronoi diagram...
performing soap bubble smoothing, sigma = 8...

Iterating 2 times
---------------------------------
3d normalization pass 1 of 2
white matter peak found at 110
white matter peak found at 110
gm peak at 43 (40), valley at 28 (25)
csf peak at 21, setting threshold to 35
building Voronoi diagram...
performing soap bubble smoothing, sigma = 8...
---------------------------------
3d normalization pass 2 of 2
white matter peak found at 110
white matter peak found at 110
gm peak at 44 (41), valley at 29 (26)
csf peak at 21, setting threshold to 36
building Voronoi diagram...
performing soap bubble smoothing, sigma = 8...
Done iterating ---------------------------------
writing output to T1.mgz
3D bias adjustment took 3 minutes and 5 seconds.

How to replicate the behavior

mri_normalize -g 1 -seed 1234 -mprage -noconform nu.mgz T1.mgz

recon-all.log

ahoopes commented 3 years ago

Unfortunately, this is not reproducible with sample data. Can you make nu.mgz available to us? Thanks

0rC0 commented 3 years ago

I cannot post it on GitHub, can I maybe have an email adress or similar to send you a link to download it? Thanks

ahoopes commented 3 years ago

No problem. Can you send it through our FTP file drop and let me know what you've saved it as?

0rC0 commented 3 years ago

Thanks!

The file is saved as nu_Issue822.mgz under transfer/incoming

ahoopes commented 3 years ago

Thanks! But looking at the file nu_Issue822.mgz, it has zero bytes, are you sure it fully uploaded?

0rC0 commented 3 years ago

Thanks! But looking at the file nu_Issue822.mgz, it has zero bytes, are you sure it fully uploaded?

Ops... sorry

now the file should be there:

ftp> cd transfer/incoming
250 Directory successfully changed.
ftp> put nu_Issue822.mgz
local: nu_Issue822.mgz remote: nu_Issue822.mgz
227 Entering Passive Mode (132,183,240,105,148,2).
150 Ok to send data.
226 Transfer complete.
6349847 bytes sent in 1.64 secs (3.6860 MB/s)
ftp>
ahoopes commented 3 years ago

Thanks. What's happening here is the normalization is struggling to fit a window to white matter intensities, and it eventually gives up. Has your recon-all input image been processed at all? It looks like it has been - maybe nonlocal filtering? If not, do you mind sending the input data as well?

0rC0 commented 3 years ago

We are analyzing 7 Tesla MP2RAGE data. If we give to recon-all the UNI T1w image, it has often problems due the "salt-pepper"-noise, with the denoised UNI T1w recon-all gives a worse segmentation due the worse contrast of the brain after denoising.

We make the brain extraction of the UNI image with SPM12 three-tissue-segmentation (it makes also a bias-field-correction with it), then we apply the brain from the UNI on the denoised and we give the resulting image to recon-all (there should be a thread from the beginning of 2017 in the mailing list about it).

We had this problem only for two of 120 subjects.

Tomorrow I can upload the original images.

0rC0 commented 3 years ago

I've uploaded also the input data: -) UNI_Issue822.nii.gz and UNIDEN_Issue822.nii.gz are the starting points for brain and background respectively. -) UNIbrain_DENbg_Issue822.nii.gz is the file I convert to mgz to be given as input to recon_all

Thaks and if you need something else, just tell me :-)

ahoopes commented 3 years ago

Sorry for the delay here. We tested things out a bit, and honestly, I think it's going to be tough to get FS to comply with data that's preprocessed like this, but you might have some luck reaching out to the FS mailing list. It's possible someone else will have a good solution. Closing this as generally, we want to reserve the github issues page for specific bugs. Although, I've put in a few checks to make sure the original error message is actually informative.