Discussion:
[ITK-users] Binary Contour with outliers
Abdelkhalek Bakkari
2018-01-23 22:06:48 UTC
Permalink
Hi !

I applied the binary contour filter slice by slice to my binary mask. But the result for the Axial plane is not satisfied at all since it contains some outliers.
Please, find attached my binary contour result.
Is there any method to remove the outliers from the contour ?

Thank you in advance.
Matt McCormick
2018-01-23 22:18:44 UTC
Permalink
Hi,

By running OpeningByReconstructionImageFilter:

https://itk.org/Doxygen/html/classitk_1_1OpeningByReconstructionImageFilter.html

before the binary contour, the smaller objects can be removed.

HTH,
Matt

On Tue, Jan 23, 2018 at 5:06 PM, Abdelkhalek Bakkari
<***@hotmail.fr> wrote:
> Hi !
>
> I applied the binary contour filter slice by slice to my binary mask. But
> the result for the Axial plane is not satisfied at all since it contains
> some outliers.
> Please, find attached my binary contour result.
> Is there any method to remove the outliers from the contour ?
>
> Thank you in advance.
>
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________
> 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:
> https://itk.org/mailman/listinfo/insight-users
>
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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:
https://itk.org/mailman/listinfo/insight-users
Becksfort, Jared
2018-01-25 23:56:15 UTC
Permalink
Hello,

I am having some difficulty overlaying boolean masks onto Nifti images. The code below is basically what is shown here (which does work for me when I use the images on the page):. https://itk.org/ITKExamples/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/Documentation.html

The differences that I can see are that I am using 3 dimensions and Nifti float input rather than 2D images of the same pixel and file types (8-bit PNG) in the example.

Can someone please tell me what I have done wrong? The output image is garbled beyond recognition.

Thanks,
Jared

const unsigned int Dimension = 3;

typedef float PixelType;
typedef unsigned char LabelType;

typedef itk::Image< PixelType, Dimension > ImageVolumeType;
typedef itk::Image< LabelType, Dimension > ContourVolumeType;

typedef itk::ImageFileReader<ContourVolumeType> ContourReaderType;
typedef itk::ImageFileReader< ImageVolumeType > ReaderType;

ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( infile1 );

ContourReaderType::Pointer labelReader = ContourReaderType::New();
labelReader->SetFileName(infile2);

typedef itk::LabelObject< LabelType, Dimension > LabelObjectType;
typedef itk::LabelMap< LabelObjectType > LabelMapType;

typedef itk::LabelImageToLabelMapFilter< ContourVolumeType, LabelMapType > ConverterType;
ConverterType::Pointer converter = ConverterType::New();
converter->SetInput( labelReader->GetOutput() );

typedef itk::LabelMapOverlayImageFilter< LabelMapType, ImageVolumeType > FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetInput( converter->GetOutput() );
filter->SetFeatureImage( reader->GetOutput() );
filter->SetOpacity(0.5);


typedef itk::ImageFileWriter< FilterType::OutputImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outfile);
writer->SetInput( filter->GetOutput() );
writer->Update();

On 1/23/18, 4:19 PM, "Insight-users on behalf of Matt McCormick" <insight-users-***@itk.org on behalf of ***@kitware.com> wrote:

Hi,

By running OpeningByReconstructionImageFilter:

https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FDoxygen%2Fhtml%2Fclassitk_1_1OpeningByReconstructionImageFilter.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=qbR%2BtUIsnrSfh01yNV9w94GGa%2FdEA7uXrisa%2BpVyJ0k%3D&reserved=0

before the binary contour, the smaller objects can be removed.

HTH,
Matt

On Tue, Jan 23, 2018 at 5:06 PM, Abdelkhalek Bakkari
<***@hotmail.fr> wrote:
> Hi !
>
> I applied the binary contour filter slice by slice to my binary mask. But
> the result for the Axial plane is not satisfied at all since it contains
> some outliers.
> Please, find attached my binary contour result.
> Is there any method to remove the outliers from the contour ?
>
> Thank you in advance.
>
> The ITK community is transitioning from this mailing list to
> discourse.itk.org. Please join us there!
> ________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0
>
> Kitware offers ITK Training Courses, for more information visit:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0
>
> Please keep messages on-topic and check the ITK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0
>
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0

Visit other Kitware open-source projects at
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0

Kitware offers ITK Training Courses, for more information visit:
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0

Please keep messages on-topic and check the ITK FAQ at:
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0



________________________________

Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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:
https://itk.org/mailman/listinfo/insight-users
Jon Haitz Legarreta
2018-01-26 08:04:09 UTC
Permalink
Dear Jared,
thanks for your question !

Your question seems to drift apart from the one that started this
thread or the subject of this thread.

In order to increase the chances of it getting answered, could please
post your question on a different thread?

Please, read our community discussion guidelines, especially the "Keep
tidy" section:
https://discourse.itk.org/guidelines

Also, providing a minimal, compilable code snippet (either through a
GitHub gist) or by attaching your own files reproducing the issue
(.cxx files, CMakeLists.txt, your own input data, etc.) would help.

Note that we are transitioning from this mailing list to discourse:
https://discourse.itk.org

So we'd be grateful if you could post your question there taking into
account the above.

Cheers,
JON HAITZ

--



On 26 January 2018 at 00:56, Becksfort, Jared
<***@stjude.org> wrote:
> Hello,
>
> I am having some difficulty overlaying boolean masks onto Nifti images. The code below is basically what is shown here (which does work for me when I use the images on the page):. https://itk.org/ITKExamples/src/Filtering/ImageFusion/OverlayLabelMapOnTopOfAnImage/Documentation.html
>
> The differences that I can see are that I am using 3 dimensions and Nifti float input rather than 2D images of the same pixel and file types (8-bit PNG) in the example.
>
> Can someone please tell me what I have done wrong? The output image is garbled beyond recognition.
>
> Thanks,
> Jared
>
> const unsigned int Dimension = 3;
>
> typedef float PixelType;
> typedef unsigned char LabelType;
>
> typedef itk::Image< PixelType, Dimension > ImageVolumeType;
> typedef itk::Image< LabelType, Dimension > ContourVolumeType;
>
> typedef itk::ImageFileReader<ContourVolumeType> ContourReaderType;
> typedef itk::ImageFileReader< ImageVolumeType > ReaderType;
>
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( infile1 );
>
> ContourReaderType::Pointer labelReader = ContourReaderType::New();
> labelReader->SetFileName(infile2);
>
> typedef itk::LabelObject< LabelType, Dimension > LabelObjectType;
> typedef itk::LabelMap< LabelObjectType > LabelMapType;
>
> typedef itk::LabelImageToLabelMapFilter< ContourVolumeType, LabelMapType > ConverterType;
> ConverterType::Pointer converter = ConverterType::New();
> converter->SetInput( labelReader->GetOutput() );
>
> typedef itk::LabelMapOverlayImageFilter< LabelMapType, ImageVolumeType > FilterType;
> FilterType::Pointer filter = FilterType::New();
> filter->SetInput( converter->GetOutput() );
> filter->SetFeatureImage( reader->GetOutput() );
> filter->SetOpacity(0.5);
>
>
> typedef itk::ImageFileWriter< FilterType::OutputImageType > WriterType;
> WriterType::Pointer writer = WriterType::New();
> writer->SetFileName(outfile);
> writer->SetInput( filter->GetOutput() );
> writer->Update();
>
> On 1/23/18, 4:19 PM, "Insight-users on behalf of Matt McCormick" <insight-users-***@itk.org on behalf of ***@kitware.com> wrote:
>
> Hi,
>
> By running OpeningByReconstructionImageFilter:
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FDoxygen%2Fhtml%2Fclassitk_1_1OpeningByReconstructionImageFilter.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=qbR%2BtUIsnrSfh01yNV9w94GGa%2FdEA7uXrisa%2BpVyJ0k%3D&reserved=0
>
> before the binary contour, the smaller objects can be removed.
>
> HTH,
> Matt
>
> On Tue, Jan 23, 2018 at 5:06 PM, Abdelkhalek Bakkari
> <***@hotmail.fr> wrote:
> > Hi !
> >
> > I applied the binary contour filter slice by slice to my binary mask. But
> > the result for the Axial plane is not satisfied at all since it contains
> > some outliers.
> > Please, find attached my binary contour result.
> > Is there any method to remove the outliers from the contour ?
> >
> > Thank you in advance.
> >
> > The ITK community is transitioning from this mailing list to
> > discourse.itk.org. Please join us there!
> > ________________________________
> > Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0
> >
> > Visit other Kitware open-source projects at
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0
> >
> > Follow this link to subscribe/unsubscribe:
> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0
> >
> The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
> ________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0
>
> Kitware offers ITK Training Courses, for more information visit:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0
>
> Please keep messages on-topic and check the ITK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0
>
>
>
> ________________________________
>
> Email Disclaimer: www.stjude.org/emaildisclaimer
> Consultation Disclaimer: www.stjude.org/consultationdisclaimer
> The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
> ________________________________
> 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:
> https://itk.org/mailman/listinfo/insight-users
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
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:
https://itk.org/mailman/listinfo/insight-users
Becksfort, Jared
2018-01-26 16:56:37 UTC
Permalink
Yes, sorry. I sent another email with the proper format shortly thereafter. Sorry for the noise.


Jared

________________________________
From: Jon Haitz Legarreta <***@vicomtech.org>
Sent: Friday, January 26, 2018 2:04:09 AM
To: Becksfort, Jared
Cc: ITK Users
Subject: Re: [ITK-users] Binary Contour with outliers

Dear Jared,
thanks for your question !

Your question seems to drift apart from the one that started this
thread or the subject of this thread.

In order to increase the chances of it getting answered, could please
post your question on a different thread?

Please, read our community discussion guidelines, especially the "Keep
tidy" section:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscourse.itk.org%2Fguidelines&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=xPacI3N%2B2bxM6VjGt5o%2Be7JQjrd7fAtQS12nDxDmdWk%3D&reserved=0

Also, providing a minimal, compilable code snippet (either through a
GitHub gist) or by attaching your own files reproducing the issue
(.cxx files, CMakeLists.txt, your own input data, etc.) would help.

Note that we are transitioning from this mailing list to discourse:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscourse.itk.org&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=Ml2KzsOGytZ5ylV9khEWD0rs3QA89TRY2W8IWdCO8tw%3D&reserved=0

So we'd be grateful if you could post your question there taking into
account the above.

Cheers,
JON HAITZ

--



On 26 January 2018 at 00:56, Becksfort, Jared
<***@stjude.org> wrote:
> Hello,
>
> I am having some difficulty overlaying boolean masks onto Nifti images. The code below is basically what is shown here (which does work for me when I use the images on the page):. https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FITKExamples%2Fsrc%2FFiltering%2FImageFusion%2FOverlayLabelMapOnTopOfAnImage%2FDocumentation.html&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=j7IB4JaPUdTP%2BnMM4ez7Hb4aiuOQ%2Fk41WI2RCh%2FvQJA%3D&reserved=0
>
> The differences that I can see are that I am using 3 dimensions and Nifti float input rather than 2D images of the same pixel and file types (8-bit PNG) in the example.
>
> Can someone please tell me what I have done wrong? The output image is garbled beyond recognition.
>
> Thanks,
> Jared
>
> const unsigned int Dimension = 3;
>
> typedef float PixelType;
> typedef unsigned char LabelType;
>
> typedef itk::Image< PixelType, Dimension > ImageVolumeType;
> typedef itk::Image< LabelType, Dimension > ContourVolumeType;
>
> typedef itk::ImageFileReader<ContourVolumeType> ContourReaderType;
> typedef itk::ImageFileReader< ImageVolumeType > ReaderType;
>
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( infile1 );
>
> ContourReaderType::Pointer labelReader = ContourReaderType::New();
> labelReader->SetFileName(infile2);
>
> typedef itk::LabelObject< LabelType, Dimension > LabelObjectType;
> typedef itk::LabelMap< LabelObjectType > LabelMapType;
>
> typedef itk::LabelImageToLabelMapFilter< ContourVolumeType, LabelMapType > ConverterType;
> ConverterType::Pointer converter = ConverterType::New();
> converter->SetInput( labelReader->GetOutput() );
>
> typedef itk::LabelMapOverlayImageFilter< LabelMapType, ImageVolumeType > FilterType;
> FilterType::Pointer filter = FilterType::New();
> filter->SetInput( converter->GetOutput() );
> filter->SetFeatureImage( reader->GetOutput() );
> filter->SetOpacity(0.5);
>
>
> typedef itk::ImageFileWriter< FilterType::OutputImageType > WriterType;
> WriterType::Pointer writer = WriterType::New();
> writer->SetFileName(outfile);
> writer->SetInput( filter->GetOutput() );
> writer->Update();
>
> On 1/23/18, 4:19 PM, "Insight-users on behalf of Matt McCormick" <insight-users-***@itk.org on behalf of ***@kitware.com> wrote:
>
> Hi,
>
> By running OpeningByReconstructionImageFilter:
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2FDoxygen%2Fhtml%2Fclassitk_1_1OpeningByReconstructionImageFilter.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=qbR%2BtUIsnrSfh01yNV9w94GGa%2FdEA7uXrisa%2BpVyJ0k%3D&reserved=0
>
> before the binary contour, the smaller objects can be removed.
>
> HTH,
> Matt
>
> On Tue, Jan 23, 2018 at 5:06 PM, Abdelkhalek Bakkari
> <***@hotmail.fr> wrote:
> > Hi !
> >
> > I applied the binary contour filter slice by slice to my binary mask. But
> > the result for the Axial plane is not satisfied at all since it contains
> > some outliers.
> > Please, find attached my binary contour result.
> > Is there any method to remove the outliers from the contour ?
> >
> > Thank you in advance.
> >
> > The ITK community is transitioning from this mailing list to
> > discourse.itk.org. Please join us there!
> > ________________________________
> > Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0
> >
> > Visit other Kitware open-source projects at
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0
> >
> > Follow this link to subscribe/unsubscribe:
> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0
> >
> The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
> ________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=wGgpmJ1V9kHLAeehfcg2TDwAl2%2B146KjXnNcJwxCUUE%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=NV76hUF0Y4voqN%2BMyiz9V5VES8ByVlx6u8soSOw%2FUG0%3D&reserved=0
>
> Kitware offers ITK Training Courses, for more information visit:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=3ZE7IOXhdYDA7yn8FEmJBbbqsRS22LsDgcLGsCOpMXI%3D&reserved=0
>
> Please keep messages on-topic and check the ITK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=zmDoewconF3K2V%2FHEljYWpZjjkqEM3zMgZomfc5XR6A%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7Cjared.becksfort%40stjude.org%7Ce86b42bd4f52460a362708d562af538f%7C22340fa892264871b677d3b3e377af72%7C0&sdata=PBR%2BffFfgYSx2PuXw7dHbVf11DqJ9i%2BW%2Fd1GB2qzq40%3D&reserved=0
>
>
>
> ________________________________
>
> Email Disclaimer: https://na01.safelinks.protection.outlook.com/?url=www.stjude.org%2Femaildisclaimer&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=4Id6vNsMKmFkssxg1f%2F%2BVxhF4QMoRYlPx4SzRfNxH6o%3D&reserved=0
> Consultation Disclaimer: https://na01.safelinks.protection.outlook.com/?url=www.stjude.org%2Fconsultationdisclaimer&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=8cUCE4yCncK6AQk9GCFmtMlVwrZYOPrpch%2FHH0Ukhts%3D&reserved=0
> The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
> ________________________________
> Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=yvhYZsACHrqPH8TCuJR6cvvIebX%2BAy2tZimD2D1mlfI%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=fvgazDqOOgDuIsS9dW%2F0b6m%2F0wQnmoCfg9ZdA3fI8OA%3D&reserved=0
>
> Kitware offers ITK Training Courses, for more information visit:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=VbzvGi96UoRD%2Fg9W97KzXUL9eBbi4M7psSj5EFUvA9c%3D&reserved=0
>
> Please keep messages on-topic and check the ITK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=D%2FmtapoFXbMzmkB6NffisrNQEZ9Te3tqobv1kzx3I6Q%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fitk.org%2Fmailman%2Flistinfo%2Finsight-users&data=01%7C01%7CJared.Becksfort%40stjude.org%7C2070d2bf4b7944b95bb308d564937a1b%7C22340fa892264871b677d3b3e377af72%7C0&sdata=%2FxQDcVnEX3RIGbxcMYyzPg3Zz8m%2BERoDnjbfOFc85Vs%3D&reserved=0

________________________________

Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
Loading...