View Issue Details

IDProjectCategoryView StatusLast Update
0003125Slicer4Core: MRMLpublic2017-06-07 23:27
Reporterhjmjohnson Assigned Topieper  
PriorityimmediateSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.2-1 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003125: Compressed Nifti files not stored properly in MRML
Description

The double extension of .nii.gz is not being preserved. when writing the file in the MRML scene.

Steps To Reproduce

After starting Slicer with any compressed nifti file:

ANY_COMPRESSED_NIFTI_FILE=/Users/johnsonhj/Dropbox/DATA/ANTS_NIPYPE_SMALL_TEST/orig_data/SUBJ_A_small_T1.nii.gz

/Applications/Slicer.app/Contents/MacOS/Slicer $ANY_COMPRESSED_NIFTI_FILE

Then save the MRML scene.

grep $(basename ${ANY_COMPRESSED_NIFTI_FILE//.nii.gz/}) *.mrml

id="vtkMRMLVolumeArchetypeStorageNode4"    name="VolumeArchetypeStorage_3"    hideFromEditors="true"    selectable="true"    selected="false"    fileName="Dropbox/DATA/ANTS_NIPYPE_SMALL_TEST/orig_data/SUBJ_A_small_T1.gz"    useCompression="1"    readState="0"    writeState="0"    centerImage="0"    singleFile="0"    UseOrientationFromFile="1"  ></VolumeArchetypeStorage>

NOTE THE fileName: SUBJ_A_small_T1.gz <-- is missing the .nii part.

TagsNo tags attached.

Relationships

related to 0002326 closedpieper Save Data should always make unique filenames 
parent of 0003373 closedlassoan File names with many dots create unintended effect in "Save data" 
related to 0003374 closedpieper Volumes loaded from DICOM that have dots in filename cannot be assigned a static file name 

Activities

hjmjohnson

hjmjohnson

2013-07-11 05:36

developer   ~0009005

echo "STEP 1: Download any compressed nifti file"
curl http://slicer.kitware.com/midas3/download/bitstream/9847/ANON0006_20_T1_sag_twisted.nii.gz -o test.nii.gz

echo "STEP 2: Load file in slicer"
/scratch/johnsonhj/src/Slicer-build/Slicer-build/Slicer test.nii.gz

echo "STEP 3: Save mrml scene"
<<< [File][Save], Then save the MRML scene >>>

echo "STEP 4: Load mrml scene"
/scratch/johnsonhj/src/Slicer-build/Slicer-build/Slicer 2013-07-11-Scene.mrml

echo "STEP 5: scratch head as to why the scene looks wrong"

ERROR: In /scratch/johnsonhj/src/Slicer/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx, line 367
vtkMRMLVolumeArchetypeStorageNode (0x7fa9cba0da70): ReadData: Cannot read file as a volume of type Volume[fullName = /scratch/test.gz]
Number of files listed in the node = 0.
File reader says it was able to read 0 files.
File reader used the archetype file name of /scratch/test.gz []

echo "STEP 5: Notice file name is wrong: '/scratch/test.gz' instead of '/scratch/test.nii.gz'"

pieper

pieper

2013-07-11 13:19

administrator   ~0009017

Reminder sent to: finetjul, pieper

I've added myself and Julien to monitor this issue. I'm hoping Julien can provide a pointer to the right place to look for a fix to this (or even better maybe he knows a good fix).

pieper

pieper

2013-07-11 13:32

administrator   ~0009018

I'll bet it's related to this change [1] that was an attempt to fix [2]. I could believe it because QFileInfo::suffix probably doesn't understand .nii.gz.

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Base/QTGUI/qSlicerSaveDataDialog.cxx?r1=22004&amp;r2=22003&amp;pathrev=22004

[2] http://na-mic.org/Bug/view.php?id=2326

finetjul

finetjul

2013-07-11 13:42

administrator   ~0009019

The file path is ...nii.gz until the save data dialog is open. it then becomes .gz

jcfr

jcfr

2013-07-11 13:50

administrator   ~0009020

Function "completeSuffix" should probably be used.
See http://qt-project.org/doc/qt-4.7/qfileinfo.html#id-df803c53-a727-4600-bed4-c3479ab29152

pieper

pieper

2013-07-30 09:48

administrator   ~0009273

@Hans: did it ever work in slicer4 to open a .nii.gz file and save the scene with a reference to it? I'm just trying to get a sense of how extensive the changes need to be. I don't think my recent changes related to 0002326 are the only thing going on here.

pieper

pieper

2013-07-30 09:52

administrator   ~0009274

Never mind - I see now. The behavior is different because now the volume is selected for saving by default, whereas previously the filename was wrong (test.nii.nrrd) but wasn't being used. You can ignore the question in comment 9273.

hjmjohnson

hjmjohnson

2013-07-30 09:55

developer   ~0009275

Thanks for looking into this. It has been a major source of frustration for our lab.

Hans

pieper

pieper

2013-07-30 10:09

administrator   ~0009276

Please try r22246.

hjmjohnson

hjmjohnson

2013-07-30 11:25

developer   ~0009283

Number of instantiated modules: 125
2013-07-30 14:22:43.592 Slicer[49821:707] invalid drawable
2013-07-30 14:22:43.594 Slicer[49821:707] invalid drawable
Number of loaded modules: 125
Show module (name): "ViewControllers"
WARNING: qSlicerViewControllersModule ::helpText() is not implemented
ERROR: In /Users/johnsonhj/src/Slicer/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx, line 367
vtkMRMLVolumeArchetypeStorageNode (0x7f83513c9410): ReadData: Cannot read file as a volume of type Volume[fullName = /Volumes/Macintosh HD/scratch/HDNI_001/012366774/012366774_20110722_30/ANONRAW/012366774_012366774_20110722_30_T1-30_3.nii.nii.gz]
Number of files listed in the node = 0.
File reader says it was able to read 0 files.
File reader used the archetype file name of /Volumes/Macintosh HD/scratch/HDNI_001/012366774/012366774_20110722_30/ANONRAW/012366774_012366774_20110722_30_T1-30_3.nii.nii.gz []

The issue is still not fixed. now the file that is attempting to be read has ".nii.nii.gz" as the extension.

pieper

pieper

2013-07-30 12:00

administrator   ~0009286

Okay I'll keep investigating.

pieper

pieper

2013-08-06 05:21

administrator   ~0009388

Okay - I think I've got it this time. We could investigate other ways of managing default filenames but this should at least fix the regression. Try r22259

hjmjohnson

hjmjohnson

2013-10-08 06:31

developer   ~0010152

This is now working.

Hans

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 88f78008

2013-07-30 14:08:47

pieper

Details Diff
BUG: 0003125 preserve .nii.gz extension on scene save

Use completeSuffix per suggestion from jcfr.

Note this code may still change as I work on fixes for 0002326.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22246 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Base/QTGUI/qSlicerSaveDataDialog.cxx Diff File

Slicer: 2145-support-for-installing-extension-from-file b1db2147

2013-08-06 09:20:50

pieper

Details Diff
BUG: 0003125 filename not changed if it is still default from load

The file load mechanism assigns a default node name based on
the filename. If the node no longer has that default name, update
the filename to match what the user provided.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22259 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Base/QTGUI/qSlicerSaveDataDialog.cxx Diff File

Slicer: 2145-support-for-installing-extension-from-file 2c0985ad

2013-08-06 09:43:58

pieper

Details Diff
BUG: 0002326 mark a node as modified if the name has changed

When the user has changed the name of a node this is
reflected in the suggested name of the file (see issue 0003125).
With this fix the node is also marked as modified so that
it will be checked for saving.

This means that changing the name of a node in the scene will
cause it to be saved to a new file on disk which is a slight change
in behavior and may cause people to use more disk space. But in
general I think this is safer and more clear, since file names will
always match the name of the node in the scene and users will
prefer that I believe.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22260 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Base/QTGUI/qSlicerSaveDataDialog.cxx Diff File
mod - Libs/MRML/Core/vtkMRMLStorableNode.h Diff File

Issue History

Date Modified Username Field Change
2013-05-20 09:08 hjmjohnson New Issue
2013-05-20 09:08 hjmjohnson Status new => assigned
2013-05-20 09:08 hjmjohnson Assigned To => jcfr
2013-05-20 11:39 jcfr Target Version Slicer 4.4.0 => Slicer 4.3.0
2013-07-11 05:36 hjmjohnson Note Added: 0009005
2013-07-11 05:37 hjmjohnson Priority high => immediate
2013-07-11 05:37 hjmjohnson Severity major => block
2013-07-11 05:37 hjmjohnson Projection none => tweak
2013-07-11 05:37 hjmjohnson ETA none => < 1 week
2013-07-11 13:19 pieper Note Added: 0009017
2013-07-11 13:32 pieper Relationship added related to 0002326
2013-07-11 13:32 pieper Note Added: 0009018
2013-07-11 13:33 pieper Assigned To jcfr => pieper
2013-07-11 13:42 finetjul Note Added: 0009019
2013-07-11 13:50 jcfr Note Added: 0009020
2013-07-30 09:48 pieper Note Added: 0009273
2013-07-30 09:52 pieper Note Added: 0009274
2013-07-30 09:55 hjmjohnson Note Added: 0009275
2013-07-30 10:09 pieper Note Added: 0009276
2013-07-30 10:09 pieper Status assigned => resolved
2013-07-30 10:09 pieper Fixed in Version => Slicer 4.3.0
2013-07-30 10:09 pieper Resolution open => fixed
2013-07-30 11:25 hjmjohnson Note Added: 0009283
2013-07-30 11:25 hjmjohnson Status resolved => feedback
2013-07-30 11:25 hjmjohnson Resolution fixed => reopened
2013-07-30 12:00 pieper Note Added: 0009286
2013-08-06 05:21 pieper Note Added: 0009388
2013-08-06 05:21 pieper Status feedback => resolved
2013-08-06 05:21 pieper Resolution reopened => fixed
2013-09-04 19:05 fedorov Relationship added parent of 0003373
2013-09-05 15:13 fedorov Relationship added related to 0003374
2013-10-08 06:31 hjmjohnson Note Added: 0010152
2013-10-08 06:31 hjmjohnson Status resolved => closed
2017-06-07 23:27 pieper Changeset attached => Slicer 2145-support-for-installing-extension-from-file 2c0985ad
2017-06-07 23:27 pieper Changeset attached => Slicer 2145-support-for-installing-extension-from-file b1db2147
2017-06-07 23:27 pieper Changeset attached => Slicer 2145-support-for-installing-extension-from-file 88f78008