[Insight-users] VTK ITK pipeline update issues !

Shankar Narayana shank.nasa at gmail.com
Wed Aug 26 11:50:33 EDT 2009


Hi ,
 I am a graduate student working with Qt, ITK and VTK. I have a volume from
which I get a slice through VTK. Then, I pass the 2D slice through ITK to
increase the gain and get it back to VTK. But when I check my output, there
is no increase in gain. I am using ShiftScaleInPlaceImageFilter with scale
set to 6.0 to increase my gain.
  The intensity of VTK slice pixels varies from 0 to 78. Even after passing
through the shiftscale filter, my output varies from 0 to 78. I expected
this to increase so that the image becomes brighter. Now, I am not sure
whether my ITK filter is actually doing something. I have set the pipeline
like this:

    vtk_to_itk->Update();

itk_from_vtk->SetUpdateInformationCallback(vtk_to_itk->GetUpdateInformationCallback());

itk_from_vtk->SetPipelineModifiedCallback(vtk_to_itk->GetPipelineModifiedCallback());

itk_from_vtk->SetWholeExtentCallback(vtk_to_itk->GetWholeExtentCallback());
    itk_from_vtk->SetSpacingCallback(vtk_to_itk->GetSpacingCallback());
    itk_from_vtk->SetOriginCallback(vtk_to_itk->GetOriginCallback());

itk_from_vtk->SetScalarTypeCallback(vtk_to_itk->GetScalarTypeCallback());

itk_from_vtk->SetNumberOfComponentsCallback(vtk_to_itk->GetNumberOfComponentsCallback());

itk_from_vtk->SetPropagateUpdateExtentCallback(vtk_to_itk->GetPropagateUpdateExtentCallback());

itk_from_vtk->SetUpdateDataCallback(vtk_to_itk->GetUpdateDataCallback());

itk_from_vtk->SetDataExtentCallback(vtk_to_itk->GetDataExtentCallback());

itk_from_vtk->SetBufferPointerCallback(vtk_to_itk->GetBufferPointerCallback());
    itk_from_vtk->SetCallbackUserData(vtk_to_itk->GetCallbackUserData());
    itk_from_vtk->Update();
    m_GainFilter=GainFilterType::New();  // GainFilter type is typedef to
ShiftScaleImageInPlaceFilter
    m_GainFilter->SetShift(0.0);
    m_GainFilter->SetScale(6.0);
    m_GainFilter->SetInput(itk_from_vtk->GetOutput());
    m_GainFilter->SetInput(GaussianNoise->GetOutput()); // Changed by
Shankar to itk_from_vtk from m_BCFilter
    m_GainFilter->Update();

   itk_to_vtk->SetInput(m_GainFilter->GetOutput());
   itk_to_vtk->Update();


vtk_from_itk->SetUpdateInformationCallback(itk_to_vtk->GetUpdateInformationCallback());

vtk_from_itk->SetPipelineModifiedCallback(itk_to_vtk->GetPipelineModifiedCallback());

vtk_from_itk->SetWholeExtentCallback(itk_to_vtk->GetWholeExtentCallback());
    vtk_from_itk->SetSpacingCallback(itk_to_vtk->GetSpacingCallback());
    vtk_from_itk->SetOriginCallback(itk_to_vtk->GetOriginCallback());

vtk_from_itk->SetScalarTypeCallback(itk_to_vtk->GetScalarTypeCallback());

vtk_from_itk->SetNumberOfComponentsCallback(itk_to_vtk->GetNumberOfComponentsCallback());

vtk_from_itk->SetPropagateUpdateExtentCallback(itk_to_vtk->GetPropagateUpdateExtentCallback());

vtk_from_itk->SetUpdateDataCallback(itk_to_vtk->GetUpdateDataCallback());

vtk_from_itk->SetDataExtentCallback(itk_to_vtk->GetDataExtentCallback());

vtk_from_itk->SetBufferPointerCallback(itk_to_vtk->GetBufferPointerCallback());
    vtk_from_itk->SetCallbackUserData(itk_to_vtk->GetCallbackUserData());
    vtk_from_itk->Update();

   When I check the range of values for vtk_to_itk and vtk_from_itk, they
seems to be same. But i wanted to increase the intensity by passing through
the ShiftScale filter. Can somebody please help me out in this issues.

  I get image slice not from any file but from VTK in realtime from a
volume.

Regards,
Shankar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090826/6c95aa6e/attachment.htm>


More information about the Insight-users mailing list