isis-group / isis

The ISIS project aims to provide a framework to access a large variety of image processing libraries written in different programming languages and environments.
GNU General Public License v3.0
18 stars 14 forks source link

type conversion on empty images is broken #43

Closed DerOrfa closed 12 years ago

DerOrfa commented 12 years ago

Calling isisconv at any image with only one value (mostly considered "empty" :-) ) and a scaling conversion into another type is done, it will crash.

Example:

isisconv -in /scr/mrincoming7t/PostMortem/PMB100520.PostMortem/nifti/S102_MEAN_mp2rage_7T_0_35_96Avg_T1map.nii -out test.png

aborts with the Assertion "minval < maxval" failing in isis::data::getNumericScaling.

This is actually more troublesome than it might look like. (And a little bit embarrassing - shame on me)

We need minval to be less than maxval to calculate the scaling. And we need the scaling, to make sure the data will fit into the target type (even if there is only one distinct value).