Hey ANka,<br><br>Maybe my intial attempt at vtkImageMapToWindowLevelColor objects was wrong.<br><br>I have a question to you about the look up table. In your code:<br><pre>m_displayWindowLevelColorsImage->SetInput(m_displayImage->GetOutput());
<br>m_displayWindowLevelColorsImage->SetLookupTable(lut);<br>m_displayWindowLevelColorsImage->SetWindow(m_win_level[0]*scale);<br>m_displayWindowLevelColorsImage->SetLevel(m_win_level[1]*scale);<br><br>My input data is of type unsigned short and the data intensity values vary from 1000 to 20000.
<br><br>Now, I want to present the user with this window and to be able to set the width of this intensity window. <br>The filter will change the scalar type to unsigned char. I am wondering how I should generate this look up
<br>table so that it will cover my data.<br></pre>Thanks,<br><br>Luca<br><br><div><span class="gmail_quote">On 4/17/07, <b class="gmail_sendername">Anka Kochanowska</b> <<a href="mailto:anka@bic.mni.mcgill.ca">anka@bic.mni.mcgill.ca
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Ok, here is a part of my real program.<br>I would send you the whole class, but cannot do it without my boss'
<br>approval.<br>Anka<br><br> vtkSmartPointer<vtkImageReslice> m_reslice;<br>...<br> m_reslice->SetInput( m_imageData );<br> m_reslice->SetInterpolationModeToLinear( );<br> m_reslice->SetOutputExtent(0, 639, 0, 479, 0, 1);
<br> m_reslice->SetOutputOrigin(0, 0, 0);<br> m_reslice->SetOutputDimensionality(2);<br> m_reslice->SetOutputSpacing(1,1,1);<br> m_reslice->SetResliceTransform( concat );<br> m_reslice->UpdateInformation();
<br><br> m_displayImage = vtkSmartPointer<vtkImageShiftScale>::New();<br> m_displayImage->SetInput(m_reslice->GetOutput());<br> m_displayImage->SetScale(scale);<br> m_displayImage->SetOutputScalarTypeToUnsignedChar();
<br><br> m_displayWindowLevelColorsImage =<br>vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();<br><br>m_displayWindowLevelColorsImage->SetInput(m_displayImage->GetOutput());<br><br> m_displayWindowLevelColorsImage->SetLookupTable(lut);
<br> m_displayWindowLevelColorsImage->SetWindow(m_win_level[0]*scale);<br> m_displayWindowLevelColorsImage->SetLevel(m_win_level[1]*scale);<br> m_mriActor->SetInput(m_displayWindowLevelColorsImage->GetOutput());
<br> m_mriRenderer->AddViewProp( m_mriActor );<br><br>m_mriOutlineFilter->SetInput(m_displayWindowLevelColorsImage->GetOutput());<br> m_mriOutlineMapper->SetInput( m_usOutlineFilter->GetOutput() );
<br> m_mriRenderer->AddViewProp( m_mriOutlineActor );<br><br><br>Luca Pamparana wrote:<br><br>> Hey Anka,<br>><br>> Thanks again for the reply.<br>><br>> The thing is that I am using the reslicer to extract a 2D slice and
<br>> just display that. All the interpolation, orientation, which slice to<br>> extract etc. is controlled by the reslicer.<br>><br>> The vtkImageActor seems to have its own corresponding methods for<br>> these operations. I am wondering if these can coexist... Only one way
<br>> to find out, I guess! Time for try some quick hack...<br>><br>> Thanks,<br>> Luca.<br>><br>> On 4/17/07, *Anka Kochanowska* < <a href="mailto:anka@bic.mni.mcgill.ca">anka@bic.mni.mcgill.ca</a><br>
> <mailto:<a href="mailto:anka@bic.mni.mcgill.ca">anka@bic.mni.mcgill.ca</a>>> wrote:<br>><br>> I am using vtkImageActor:<br>><br>><br>> vtkImageActor * mriActor;<br>> ...
<br>> ...<br>> blendedImage->AddInput( 0, img1->GetOutput());<br>> blendedImage->AddInput( 0,<br>> .displayWindowLevelColorsImage->GetOutput());<br>> blendedImage->Update();
<br>> mriActor->SetInput(blendedImage->GetOutput());<br>> renderer->AddViewProp( mriActor );<br>> Anka<br>><br>> Luca Pamparana wrote:<br>><br>> > Hello everyone,
<br>> ><br>> > I am unable to get the vtkImageMapToWindowLevelColors to give me an<br>> > output :(<br>> ><br>> > My pipeline is as follows:<br>> ><br>> > // vtkImageData input to a reslicer
<br>> > this->m_slicer->SetInput(in);<br>> ><br>> > // pass the output of the slicer to<br>> vtkImageMapToWindowLevelColors object<br>> ><br>> this->m_windowLevelMapper->SetInputConnection(this->m_slicer->GetOutputPort());
<br>> ><br>> ><br>> > // Pipe the output to a vtkImageBlend object<br>> > this->m_blender->AddInputConnection(0,<br>> > this->m_windowLevelMapper->GetOutputPort());
<br>> ><br>> > // Pipe output to a vtkImageMapper. This mapper is tied to the<br>> Actor2D<br>> > // object that is added to the renderer<br>> > this->m_imageMapper->SetInput(this->m_blender->GetOutput());
<br>> ><br>> > double * range = in->GetScalarRange();<br>> > if (range)<br>> > {<br>> > // this calls the ciorresponding methods on the<br>> > vtkImageMapToWindowLevelColors object
<br>> > this->SetColorWindow(range[1] - range[0]);<br>> > this->SetColorLevel(0.5 * (range[1] + range[0]));<br>> > }<br>> ><br>> > SetSlice(static_cast<int>((GetWholeZMin() + GetWholeZMax()) *
0.5));<br>> ><br>> > My guess is that I am not setting the ColorWindow and ColorLevel on<br>> > the vtkImageMapper instance. However, I want to control the color<br>> > window and color level values independently of the mapper as the
<br>> > vtkImageBlend will also have other inputs that I want to control<br>> the<br>> > window and level values for.<br>> ><br>> > Any help on how I can get this to work is much appreciated.
<br>> ><br>> > Thanks,<br>> > Luca<br>> ><br>> >------------------------------------------------------------------------<br>><br>> ><br>> >_______________________________________________
<br>> >This is the private VTK discussion list.<br>> >Please keep messages on-topic. Check the FAQ at:<br>> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a> <<a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a>><br>> >Follow this link to subscribe/unsubscribe:<br>> ><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
> ><br>> ><br>><br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>This is the private VTK discussion list.
<br>>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>>Follow this link to subscribe/unsubscribe:<br>><a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br>><br></blockquote></div><br>