Post Reply 
conceptual problem with given NRRD files?
11-19-2014, 02:09 AM (This post was last modified: 11-19-2014 02:13 AM by mcarter.)
Post: #2
RE: conceptual problem with given NRRD files?
I kept a min and max variable as I was reading the data file. For each value read in, if it is greater than max, update max. Same for min.

I guess it depends on the data set whether or not you can safely remove the values from 0 to min... I think with the brain data set, it doesn't really matter if you map colors from 0 to Max, or Min to Max, since there isn't anything special about the range 0 to 96 (the true min of brain.nrrd).

An example of when you would NOT to simply map from min to max is if you have a special color mapping that represents something. For example, if you have a geographic temperature map of the US, you wouldn't want to scale the temperature on a summer day to the min/max range for the color mapping. This way you could end up with 70 degrees in blue (indicating cold), when really it should be yellow or orange.

In the end, remember that the values are measurements from some experiment (likely scientific). The measurements of such an experiment aren't bounded by their representation in binary (well, ACTUALLY they are, since they clearly can't record a value outside of the representation, but it certainly shouldn't be scaled to this representation range).

My guess with both the MRI and MtHood data sets is that the values are scaled to a range targeted for a specific representation. The MRI max is 253, which probably means the data set was using unsigned shorts for storage. The Mt Hood data set goes from -127 to 128, which fits within a signed short.

In other words, as a scientist, you need to decide what resolution of data values you need to be able to represent. If 256 discrete values offers enough resolution, there is no reason to use an int.

Also, while the encoding directive for NRRD should tell you the min/max values of the data, there is no reason you have to use this data type in your project. I used 32 bit int in my project, for all data sets. If we needed to keep many images in memory, it might start to make sense to use a more compact representation.

Also, I'd be pretty shocked if these data sets originally came in NRRD format. I'd guess these data sets have been converted to NRRD because it's easy to work with. Real data will almost certainly not be in ASCII format.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: conceptual problem with given NRRD files? - mcarter - 11-19-2014 02:09 AM

Forum Jump:

User(s) browsing this thread: 1 Guest(s)