[vtk-developers] MINC reader artifacts

Mathieu Coursolle mcoursolle at rogue-research.com
Tue Jul 1 11:16:07 EDT 2008


Hi VTK-Dev,

I am using the vtkMINCImageReader to open MINC files.

I have a MINC file where the value range is from -4.3 to 10.9.

The fact that the range starts from a negative value seems to cause
all slices not to have the same offset.

I looked at the code, and noticed that the slope and intercept are  
compute with
the local slice minimum and maximum values.

Shouldn't it use the global minimum and maximum value (the max of  
slices max, etc.)?

Thanks!

Mathieu


     // Get the min and max values to apply to this chunk
     double chunkRange[2];
     chunkRange[0] = minPtr[minmaxIdx];
     chunkRange[1] = maxPtr[minmaxIdx];

     // Use the range to calculate a linear transformation
     // to apply to the data values of this chunk.
     double slope = ((chunkRange[1] - chunkRange[0])/
                     ((this->ValidRange[1] - this->ValidRange[0])
                      *this->RescaleSlope));
     double intercept = ((chunkRange[0] - this->RescaleIntercept)/
                         this->RescaleSlope) - slope*this- 
 >ValidRange[0];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20080701/a4306d12/attachment.html>


More information about the vtk-developers mailing list