justingardner / gru

7 stars 3 forks source link

dofmricni loads not unarchived inplane anatomies #5

Open steevelaquitaine opened 9 years ago

steevelaquitaine commented 9 years ago

dofmricni loads Inplane anatomies that are not unarchived (format .nii.gz). Clicking the files then produces .nii.gz.cpgz files. We cannot load the files as base anatomy.

dbirman commented 9 years ago

Until this is fixed you can re-download the .nii.gz files from NIMS, those files un-archive correctly into .nii files.

steevelaquitaine commented 9 years ago

Yes don't worry I did

justingardner commented 9 years ago

You should be able to load compressed nifti files (*.nii.gz) by doing:

[d h] = mlrImageLoad(‘filename.nii.gz’);

Then save it back uncompressed:

mlrImageSave(‘filename.nii’,d,h);

Also, I just fixed mrLoadRet so that it recognizes that you can load compressed nifti files, so you should be able to load from File/Base Anatomy/Load.

When you say you “clicked” on the files and got “.cpgz” files - I assume that means you clicked with the mouse from the finder? I wouldn’t do that ;)…

-j.

On Aug 6, 2015, at 1:33 PM, Steeve Laquitaine notifications@github.com wrote:

dofmricni loads Inplane anatomies that are not unarchived (format .nii.gz). Clicking the files then produces .nii.gz.cpgz files. We cannot load the files as base anatomy.

— Reply to this email directly or view it on GitHub https://github.com/justingardner/gru/issues/5.

steevelaquitaine commented 9 years ago

Yes I clicked with the mouse. Ok. Thanks !

dbirman commented 9 years ago

This fix doesn't work for me, I think that the files may be getting corrupted somewhere along the pipeline:

gunzip: anat01_10259_2_1_T1w_12mm_ax.nii.gz: not in gzip format
(cbiReadNiftiHeader) Incorrect header size (should be 348 bytes) for file anat01_10259_2_1_T1w_12mm_ax.nii
(mlrImageHeaderLoad) Could not load header for anat01_10259_2_1_T1w_12mm_ax.nii
dbirman commented 9 years ago

Re-downloading the file and clicking in the finder works fine by the way, so something is definitely going wrong somewhere in dofmricni

dbirman commented 9 years ago

Hmm, to add to the strangeness of this error it only occurs in some scans, some of my scans are unaffected... (i.e. the anat.nii file is already there unpacked)

justingardner commented 9 years ago

What scan is an example of the problem?

dbirman commented 9 years ago

s0300, scan 20150729, exam # 10255

justingardner commented 9 years ago

I ran dofmricni on exam 10255 and the anat file came out ok. wtf?

dbirman commented 9 years ago

Yeah that confirms my suspicion that the bug is fairly random. I get it in like 1 of 3 runs in all my data. Doesn't seem to be any consistency to what causes it.