View Issue Details

IDProjectCategoryView StatusLast Update
0002605Slicer4Core: Scripting (Wrapping, Python)public2014-03-06 06:09
Reporteruser349Assigned Topieper  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.1.1 
Target VersionSlicer 4.2.0Fixed in VersionSlicer 4.2.0 
Summary0002605: Windows: DICOMS + SaveSceneToSlicerDataBundleDirectory() yields 0kb .nrrd file
Description

When a DICOM set is loaded and SaveSceneToSlicerDataBundleDirectory() is called, the .nrrd file that gets written in the <scene>/Data/ directory is 0kb in size. Per the thread below, it has to do with how Windows interprets certain characters in the filename.

Additional Information

Conversation with Steve Pieper:

Ah - interesting - I think you found a windows-specific bug in the data bundle. Since the DICOM module prefixes the loaded volumes with the series number followed by a colon, the name of the volume node isn't always a valid windows path - in this case it is mistaken for a drive letter but that only happens for certain dicom series names.

I'll have to look into this and see if there's good generic fix for this. If you have a chance, could you file a bug report on this and send me the link? I've got to run now but should be able to clean it up pretty quick once I have a minute.

-Steve

On Tue, Oct 2, 2012 at 2:59 PM, Kumar, Sunil <kumars@mir.wustl.edu> wrote:

Hi Steve,

Thanks again for fielding the call today and pointing me to the MRB
file. I was testing out the highlighted lines you showed me but it
still looks as if I’m encountering the 0KB .nrrd file issue when I
call SlicerSaveSceneToDataBundleDirectory(). The weird part is it
loads fine, though the MRB does not.

Could this be because of how I how loaded the dicoms into the
slicer.dicomDatabase? (Below.)

i = ctk.ctkDICOMIndexer()

    for root, dirs, files in os.walk(cachedPath):

            for relFileName in files:

                dicomFilePath = os.path.join(root, relFileName)

                i.addFile(slicer.dicomDatabase, dicomFilePath,

cachedPath)

                slicer.app.processEvents()

I’ve attached a zip of the SaveSceneToSlicerDataBundleDirectory result
and the mrb. In the zip, you’ll find that the .nrrd file in “./Data/”
has a file size of 0. Nevertheless, it loads when I drop it into
slicer. The MRB, however, does not.

Here are my lines of python code – nothing fancy:

(First load the DICOM set into Slicer via the DICOM module.
Everything looks OK.)

applicationLogic = slicer.app.applicationLogic()

sceneSaveDirectory = 'C:/Users/skumar01/Desktop/xnatslicerbeta/saveTest'

mrbFilePath= 'C:/Users/skumar01/Desktop/xnatslicerbeta/MRBtest.mrb'

applicationLogic.SaveSceneToSlicerDataBundleDirectory(sceneSaveDire
ctory,
None)

True

applicationLogic.Zip(mrbFilePath,sceneSaveDirectory)

True

Any help you have is appreciated. Thanks again.

-Sunil

TagsNo tags attached.

Relationships

related to 0002366 closedfinetjul Saving scene in a bundle file generates invalid mrb file on Windows 

Activities

pieper

pieper

2012-10-06 05:49

administrator   ~0006420

The issue is that the MRB save function needs to make filenames for the new storage nodes it creates in the tmp directory. It uses the volume name as the basis filename.

After looking into this, I think the best solution is to url encode the filename, so that any non-letter/number characters are replaced with %HH where HH is the hex code for the character.

This won't change the name of the volume in the slicer application, just the autogenerated filename, so users won't see this unless they decide to save the volume out through another mechanism.

pieper

pieper

2012-10-15 06:29

administrator   ~0006528

This commit should take care of it:

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=21184

Sunil - can you test it out with your module and if it looks good, close this issue. If it doesn't work, just let me know and we'll dig deeper. -Steve

user349

2012-10-15 12:04

  ~0006545

Works well! Thanks so much.

Issue History

Date Modified Username Field Change
2012-10-03 08:46 user349 New Issue
2012-10-03 08:46 user349 Status new => assigned
2012-10-03 08:46 user349 Assigned To => jcfr
2012-10-03 10:04 jcfr Assigned To jcfr => pieper
2012-10-03 10:04 jcfr Target Version => Slicer 4.2.0 - coming release
2012-10-06 05:44 pieper Relationship added related to 0002366
2012-10-06 05:49 pieper Note Added: 0006420
2012-10-15 06:29 pieper Note Added: 0006528
2012-10-15 06:29 pieper Status assigned => resolved
2012-10-15 06:29 pieper Resolution open => fixed
2012-10-15 12:04 user349 Note Added: 0006545
2012-10-15 12:04 user349 Status resolved => closed
2014-03-06 06:09 jcfr Fixed in Version => Slicer 4.2.0