[Insight-users] question ? [Iterators into image series]
Ariel Hernán Curiale
curiale at gmail.com
Wed Jul 18 11:35:19 EDT 2012
Hi agatte, you can use the helper ExtractImageFilter (http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html) to extract a particular slide from a volume. You only need to set the start and size properly.
Saludos
__________________________________
| Ariel Hernán Curiale
| ETSI Telecomunicación
| Universidad de Valladolid
| Campus Miguel Delibes
| 47011 Valladolid, Spain
| Phone: 983-423000 ext. 5590
| Web: www.curiale.com.ar
|_________________________________
El 18/07/2012, a las 15:38, agatte escribió:
>
> Hi All ITK Users ;)
>
> I am fresh user.
> I want to extract each slice with two neighbors from image series.
> For example for second slice it will be 1,2,3 and save it as volume.
> I will have to be in a loop.
>
> Maybe do You have any idea or good solution for this problem ?
> I would appreciate for any help please.
>
> Here I have already created function for extract odd slices from series and
> save as volume.
> int ReadSeriesCreateVolumeP(std::string series, const char * outputVolume1P)
> {
>
>
> typedef unsigned char PixelType;
> const unsigned int Dimension = 3;
>
> typedef itk::Image< PixelType, Dimension > ImageType;
>
> typedef itk::ImageSeriesReader< ImageType > ReaderType;
> typedef itk::ImageFileWriter< ImageType > WriterType;
>
> ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
>
>
>
> const unsigned int first = atoi("0");
> const unsigned int last = atoi("127");
>
>
> typedef itk::NumericSeriesFileNames NameGeneratorType;
>
> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();
>
>
> nameGenerator->SetSeriesFormat( series );
>
> nameGenerator->SetStartIndex( first );
> nameGenerator->SetEndIndex( last );
> nameGenerator->SetIncrementIndex(2);
>
> reader->SetImageIO( itk::TIFFImageIO::New() );
>
> reader->SetFileNames( nameGenerator->GetFileNames() );
>
> writer->SetFileName(outputVolume1P);
>
> writer->SetInput( reader->GetOutput() );
>
> try
> {
> writer->Update();
> std::cout << " 3d Volume saved ! " <<std::endl;
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return EXIT_FAILURE;
> }
>
>
> return EXIT_SUCCESS;
> }
>
>
>
> I would appreciate for any help please.
>
>
> agatte ;)
>
> --
> View this message in context: http://old.nabble.com/question----Iterators-into-image-series--tp34179149p34179149.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://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120718/47461be2/attachment.htm>
More information about the Insight-users
mailing list