View Issue Details

IDProjectCategoryView StatusLast Update
0004091Slicer4Core: Base Codepublic2015-11-30 11:53
ReporterErich Bremer Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product VersionSlicer 4.5.0-1 
Target VersionFixed in Version 
Summary0004091: Cannot save label maps as png or jpg
Description

When selecting png or jpg for label maps in File->Save, the system will say that it cannot write those files. It does, however, work fine for tif.

TagsNo tags attached.

Activities

nicole

nicole

2015-11-20 07:18

administrator   ~0013637

Last edited: 2015-11-20 09:12

Error on the terminal (does show up in the error log):
itk::ExceptionObject (0x7fe3f8e933f8)
Location: "void itk::PNGImageIO::WriteSlice(const std::string &, const void *)"
File: /Users/nicole/Slicer-git/Slicer-build/ITKv4/Modules/IO/PNG/src/itkPNGImageIO.cxx
Line: 519
Description: PNG supports unsigned char and unsigned short

For the Stonybrook project we need to support IO for PNG and/or TIFF. This instance seems to be a case of needing to cast the image to be saved, and to give better feedback to the user.

nicole

nicole

2015-11-30 11:53

administrator   ~0013648

Digging into this issue, I found one bug in the volumes reader in that it was returning an improperly formatted string list of supported extensions, so PNG files weren't registered as supported.
Another complicating factor is that when you select a PNG file to be loaded, Slicer goes through various volume type readers to try and load it, and the vector file reader succeeds, so the volume node is a vtkMRMLVectorVolumeNode.

This topic branch adds a load, convert to greyscale, cast, edit, save test for a PNG file in the Stonybrook example data set online. It also fixes the volume file extensions bug as well as a copy paste one in the volumes logic:
https://github.com/naucoin/Slicer/commits/Add-png-load-edit-save-reload-test

Issue History

Date Modified Username Field Change
2015-11-20 06:47 Erich Bremer New Issue
2015-11-20 06:47 Erich Bremer Status new => assigned
2015-11-20 06:47 Erich Bremer Assigned To => jcfr
2015-11-20 07:18 nicole Note Added: 0013637
2015-11-20 09:12 nicole Note Edited: 0013637
2015-11-30 11:53 nicole Note Added: 0013648