[Insight-users] Re: Geodesic Active Contour Application
Luis Ibanez
luis.ibanez at kitware.com
Wed Jul 27 10:20:42 EDT 2005
Hi Mayuri,
Your changes for converting the GeodesicActiveContour
demo application from 3D to 2D seem to be following
the right path.
You are correct, most of the changes will be at the
level of the Base class. The second important change,
as you pointed out, is on the viewers, you may want
to simply replace the 3D viewers with the class:
fltkImage2DViewer
That are in the same directory as the fltkImageViewer,
that is:
InsightApplications/Auxiliary/FltkImageViewer/
You will have to change also the way the seed points
are captured. You are probably still using the code
where those seed points are in 3D.
Please run your application in Debug mode and let us
know in what section of the code you are getting that
run time error.
BTW: What platform are you working on ?
What compiler do you use ?
Thanks
Luis
-------------------
mayuri Narayan wrote:
> Hi Luis,
>
> I am trying to modify GeodesicActiveContour
> Application to suit 2D images. I found this post on
> ITK Users list (also pasted below) -
> http://public.kitware.com/pipermail/insight-users/2005-March/012203.html
> where you have mentioned that "You can however
> convert it to a 2D application with minimal changes".
>
> Instead of changing the FLTK Viewer to operate on 2D
> images, I decided to operate the filters on 2D images
> and modify the interface when passing the image to the
> Viewer. So,
>
> 1. I have modified ONLY GeodesicActiveContourBase.h
> and GeodesicActiveContourBase.cxx to operate on 2D
> images.
>
> 2. In GeodesicActiveContour.cxx, I have modified
> function definitons like the one shown below:
>
> void GeodesicActiveContour
> ::ShowInputImage( void )
> {
>
> if( !m_InputImageIsLoaded )
> {
> return;
> }
>
> m_CastImageFilter->Update();
> typedef itk::Image<float,3> SetImageType;
> SetImageType::Pointer setImage =
> SetImageType::New();
>
> setImage=reinterpret_cast<SetImageType*>(m_CastImageFilter->GetOutput());
> m_InputImageViewer.SetImage( setImage);
>
> typedef itk::Image<unsigned char,3>
> SetSeedImageType;
> SetSeedImageType::Pointer setSeedImage
> =SetSeedImageType::New();
> typedef itk::Image<unsigned char,2> InputSeedType;
> InputSeedType::Pointer inputSeedImage =
> InputSeedType::New();
> inputSeedImage= m_SeedImage;
>
> setSeedImage = reinterpret_cast<SetSeedImageType *
>
>>(&inputSeedImage);
>
> m_InputImageViewer.SetOverlay( setSeedImage );
>
> /*Changed the following*/
> // m_InputImageViewer.SetImage(
> m_CastImageFilter->GetOutput());
> // m_InputImageViewer.SetOverlay( m_SeedImage );
> m_InputImageViewer.Show();
>
> }
>
> Similarly I have changed the other member definitions
> in this file. The program compiles fine and at
> execution, the image is loaded and then later when I
> click Display the program aborts saying "Unknown
> exception caught in main".
>
> Question: Am I doing this right? If not, what were the
> "minimal changes" that you have talked about. Thanks a
> lot for your help.
>
> Thanks,
> Regards,
> Mayuri
>
> --------------------------------------------------
> Hi Silviu,
>
> Yes, this application expects only 3D images.
>
> You can however convert it to a 2D application with
> minimal changes.
> It depends on how familiar are you with FLTK.
>
>
> Otherwisse I'll suggest you to use the Examples in
>
>
> Insight/Examples/Segmentation/
>
>
> Which are the same illustrated in the ITK Software
> Guide
>
>
>
> Regards,
>
>
> Luis
>
>
>
> --------------------------
> Silviu Minut wrote:
>
>
>>On Tue, 22 Feb 2005 15:42:15 -0500, Jie Yu wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>I got a problem when running GeodesicActiveContour
>
> application. It's like
>
>>>that application only accepts the 3D image data
>
> cause when I was trying to
>
>>>load 2D image file as input, there was the error
>
> message "Image must be 3D
>
>>>and with at least 10 pixels along each Dimension.".
>>>
>>>Does anybody know how to apply this application to
>
> 2D image?
>
>>>Thanks a lot!
>>>
>>>Jie
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
More information about the Insight-users
mailing list