[ITK] [ITK-users] Processing 3D data question.
Krakers
jaroslawlobaza at gmail.com
Mon May 30 15:46:47 EDT 2016
Firstly thanks for your response.
I wrote a function which takes image data as input and should return
"medianized" picture, but it crushed when gets to medianFilter->Update();
// typedef itk::Image< unsigned char, 3 > ImageType3D;
median3D(ImageType3D::Pointer img)
{
ImageType3D::Pointer bin = 0;
ImageType3D::SizeType indexRadius;
indexRadius[0] = 1; // radius along x
indexRadius[1] = 1; // radius along y
indexRadius[2] = 0; // radius along z
typedef itk::MedianImageFilter< ImageType3D,
ImageType3D > MedianFilterType;
typedef itk::MedianImageFilter<ImageType3D, ImageType3D > FilterType;
FilterType::Pointer medianFilter = FilterType::New();
medianFilter->SetRadius(indexRadius);
medianFilter->SetInput(img);
try
{
medianFilter->Update();
}
catch (itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
//return EXIT_FAILURE;
}
bin = medianFilter->GetOutput();
return bin;
}
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588937.html
Sent from the ITK Insight 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
More information about the Community
mailing list