<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 29, 2017 at 10:53 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Mar 29, 2017 at 10:42 AM, David Thompson <span dir="ltr"><<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
> ...I'm planning to add a new image filter to VTK, and will name it something like vtkImageMapThroughLUT.  The operation of this filter will be as follows:<br>
<span>><br>
> - It will take, as input, any image that uses an integer scalar type<br>
> - The scalars will be mapped though a lookup table to generate the output image<br>
><br>
> For the "lookup table" or (LUT), I was planning to use a plain-old vtkDataArray.  I cannot use vtkLookupTable as the LUT, since vtkLookupTable can only produce "unsigned char" output and is meant to be used for generating color data.<br>
><br>
> My question to the list is as follows: is vtkDataArray the best object to use for storing such a LUT?<br>
<br>
</span>You might consider vtkPiecewiseFunction (in Common/DataModel).<br>
<span><br>
> Also, is there already a class in the VTK geometry pipeline that allows labels to be remapped to new label values via a LUT?<br>
<br>
</span>I don't know of any; what format are the labels in?<br></blockquote><div><br></div></span><div>The "labels", in this case, are just scalar values.  The use case is images that represent brain segmentations, where a pixel value of "0" represents nothing, a pixel value of "1" represents one particular region of the brain, a pixel value of "2" represents a different region of the brain, etc.  Such images are commonly used in neuroscience imaging research, and are often called "label images" or, depending on their use, "atlas images".</div><div><br></div><div>So we're talking about simply mapping integer scalar values through a LUT, to get a new set of integer scalar values.</div></div></div></div></blockquote><div><br></div><div>To put it another way, the labels that I'm referring to are categorical values, where all voxels with value "n" belong to "category n".</div><div><br></div><div> - David</div></div></div></div>