[Insight-users] ObjectValue ITK

Luis Ibanez luis.ibanez at kitware.com
Fri Jul 10 10:59:09 EDT 2009


Hi Noe,


One way of picking the proper pixel value is to use a
visualization application.

Any tool that allow you to click on image pixels and
see their intensity values may do the trick.

Please try:

    1) Slicer      (www.slicer.org)
    2) ImageViewer (from InsightApplications)
    3) ParaView    (www.paraview.org)


The output may not be a connected surface, because
the values may be found in multiple locations of
your image.

One way of enforcing a singl connected component
would be to use a RegionGrowing filter first,
(which requires you to place a seed point inside
the object that you want to extract).

Then you can extract the surface from the output
of the Region Growing filter.


You will find detailed descriptions of hte Region
Growing filters in the ITK Software Guide

    http://www.itk.org/ItkSoftwareGuide.pdf



    Regards,


       Luis



--------------------------
Noé Jimenez Costa wrote:
> 
> Hi all,
> 
> I working with BinaryMask3DMeshSource. If I understand correctly, the 
> filter selects pixels with a given ObjectValue parameter.
> Now, how can I get the ObjectValue parameter of a given pixel that I see 
> in an image data?
> Moreover, is there any way of enforce that the output should be a 
> connected surface?
> 
> code:
> 
> int main(int argc, char * argv[] )
> {
> 
>   if( argc < 3 )
>     {
>     std::cerr << "Usage: IsoSurfaceExtraction  inputImageFile   
> objectValue" << std::endl;
>     return EXIT_FAILURE;
>     }
> 
>   const unsigned int Dimension = 3;
>   typedef signed short PixelType;
> 
>   typedef itk::Image< PixelType, Dimension >   ImageType;
> 
>   typedef itk::ImageFileReader< ImageType >    ReaderType;
>   ReaderType::Pointer reader = ReaderType::New();
>   reader->SetFileName( argv[1] );
> 
>   try
>     {
>     reader->Update();
>     }
>   catch( itk::ExceptionObject & exp )
>     {
>     std::cerr << "Exception thrown while reading the input file " << 
> std::endl;
>     std::cerr << exp << std::endl;
>     return EXIT_FAILURE;
>     }
>  
>   typedef itk::DefaultDynamicMeshTraits<double, 3, 3,double,double> 
> TriangleMeshTraits;
>   typedef itk::Mesh<double,3, TriangleMeshTraits> MeshType;
>   typedef MeshType::Pointer MeshPointer;
>   typedef itk::BinaryMask3DMeshSource< ImageType, MeshType > MeshSourceType;
> 
>   MeshSourceType::Pointer meshSource = MeshSourceType::New();
>  
>   const PixelType objectValue = static_cast<PixelType>( atof( argv[2] ) );
>   meshSource->SetObjectValue( objectValue );
>   meshSource->SetInput( reader->GetOutput() );
> 
>   try
>     {
>     meshSource->Update();
>     }
>   catch( itk::ExceptionObject & exp )
>     {
>     std::cerr << "Exception thrown during Update() " << std::endl;
>     std::cerr << exp << std::endl;
>     return EXIT_FAILURE;
>     }
> 
>   std::cout << "Nodes = " << meshSource->GetNumberOfNodes() << std::endl;
>   std::cout << "Cells = " << meshSource->GetNumberOfCells() << std::endl;
>  
> typedef itk::VTKPolyDataWriter< MeshType > MeshWriterType;
>     MeshWriterType::Pointer meshWriter = MeshWriterType::New();
>     meshWriter->SetFileName( "newojo.vtk" );
>     meshWriter->SetInput( meshSource->GetOutput() );
>     meshWriter->Update();
> 
> return 0;
> 
> 
>   return EXIT_SUCCESS;
> }
> 
> 
> thanks,
> Noé Jiménez
> 
> ------------------------------------------------------------------------
> Disfruta antes que nadie del nuevo Windows Live Messenger 
> <http://download.live.com>
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list