[ITK] [ITK-users] itk::BinaryThinningImageFilter3D
Francisco Lopez de la Franca
franciscolopezdelafranca at gmail.com
Wed Nov 11 08:01:40 EST 2015
Hi,
I've used this filter with 3D MRI images with more resolution that
daoud23's, and my results were correct. I used 3D Slicer to visualize the
3D images and the result were interesting.
I hope this helps.
Regards.
2015-11-11 13:45 GMT+01:00 Matt McCormick <matt.mccormick at kitware.com>:
> Hello,
>
> From the screenshot, it is unclear whether the thinning worked or not
> -- it would be better to visualize in 3D instead of 2D planes.
>
> HTH,
> Matt
>
> On Wed, Nov 11, 2015 at 3:33 AM, Daoued23 <mlt.khawla at gmail.com> wrote:
> > Hello everyone,
> >
> > I want to get an Hybrid Skeleton. So I started by testing itk's filter
> > "itk::BinaryThinningImageFilter3D" to obtain the curve skeleton, but it
> > doesn't seem to work. Here is my code.
> >
> > #include "itkImage.h"
> > #include "itkImageFileReader.h"
> > #include "itkImageFileWriter.h"
> >
> > #include "itkConnectedThresholdImageFilter.h"
> > #include "itkImageRegionIterator.h"
> > #include "itkBinaryThinningImageFilter3D.h"
> >
> > #include <iostream>
> > #include <stdlib.h>
> > using namespace std;
> >
> > int main(int argc, char* argv[])
> > {
> > // Verify the number of parameters in the command line
> > if( argc <= 2 )
> > {
> > std::cerr << "Usage: " << std::endl;
> > std::cerr << argv[0] << " inputImageFile outputImageFile" <<
> std::endl;
> > return EXIT_FAILURE;
> > }
> > char* infilename = argv[1];
> > char* outfilename = argv[2];
> >
> > const unsigned int Dimension = 3;
> > typedef signed short PixelType;
> > typedef itk::Image< PixelType, Dimension > ImageType;
> >
> > // Read image
> > typedef itk::ImageFileReader< ImageType > ReaderType;
> > ReaderType::Pointer reader = ReaderType::New();
> > reader->SetFileName( infilename );
> > try
> > {
> > reader->Update();
> > }
> > catch (itk::ExceptionObject &ex)
> > {
> > std::cout << ex << std::endl;
> > return EXIT_FAILURE;
> > }
> > cout << infilename << " sucessfully read." << endl;
> >
> > // Define the thinning filter
> > typedef itk::BinaryThinningImageFilter3D< ImageType, ImageType >
> > ThinningFilterType;
> > ThinningFilterType::Pointer thinningFilter = ThinningFilterType::New();
> > thinningFilter->SetInput( reader->GetOutput() );
> > thinningFilter->Update();
> >
> > // output to file
> > typedef itk::ImageFileWriter< ImageType > WriterType;
> > WriterType::Pointer writer = WriterType::New();
> > writer->SetInput( thinningFilter->GetOutput() );
> > writer->SetFileName( outfilename );
> >
> > try
> > {
> > writer->Update();
> > }
> > catch (itk::ExceptionObject &ex)
> > {
> > std::cout << ex << std::endl;
> > return EXIT_FAILURE;
> > }
> > cout << outfilename << " sucessfully written." << endl;
> >
> > cout << "Program terminated normally." << endl;
> > return EXIT_SUCCESS;
> > }
> >
> >
> > And here is the volume I get in return, the initial volume is a region of
> > trabecular bone of size 30x30x30 voxels.
> > <http://itk-users.7.n7.nabble.com/file/n36449/thinningitk.png>
> >
> >
> >
> > --
> > View this message in context:
> http://itk-users.7.n7.nabble.com/itk-BinaryThinningImageFilter3D-tp36449.html
> > Sent from the ITK - Users mailing list archive at Nabble.com.
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php
> >
> > 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://public.kitware.com/mailman/listinfo/insight-users
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> 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://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20151111/b1d715e5/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
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://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list