<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi VTK-Dev,<div><br></div><div>I am using the vtkMINCImageReader to open MINC files.</div><div><br></div><div>I have a MINC file where the value range is from -4.3 to 10.9.</div><div><br></div><div>The fact that the range starts from a negative value seems to cause</div><div>all slices not to have the same offset.</div><div><br></div><div>I looked at the code, and noticed that the slope and intercept are compute with</div><div>the local slice minimum and maximum values.</div><div><br></div><div>Shouldn't it use the global minimum and maximum value (the max of slices max, etc.)?</div><div><br></div><div>Thanks!</div><div><br></div><div>Mathieu</div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// Get the min and max values to apply to this chunk</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #1046da">double</span> chunkRange[2];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> chunkRange[0] = minPtr[minmaxIdx];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> chunkRange[1] = maxPtr[minmaxIdx];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; min-height: 16px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// Use the range to calculate a linear transformation</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// to apply to the data values of this chunk.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #1046da">double</span> slope = ((chunkRange[1] - chunkRange[0])/</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> ((<span style="color: #1046da">this</span>->ValidRange[1] - <span style="color: #1046da">this</span>->ValidRange[0])</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> *<span style="color: #1046da">this</span>->RescaleSlope));</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #1046da">double</span> intercept = ((chunkRange[0] - <span style="color: #1046da">this</span>->RescaleIntercept)/</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Monaco; "> <span style="color: #1046da">this</span>->RescaleSlope) - slope*<span style="color: #1046da">this</span>->ValidRange[0];</div></div></body></html>