[Insight-users] Urgenthelp with Observer class to store image sequence
Jayant Chauhan
gripened@hotmail.com
Fri May 14 11:14:58 EDT 2004
<html><div style='background-color:'><DIV class=RTE>
<P>Dear Luis,</P>
<P>I tried to capture the zerocrossings ,but I get this real talked about error in the Forum. But couldnt find anything that helps in the forum.</P>
<P>I was first capturing the geodesicActiveContourFilter outputs using my observer, but now when I try to go down further in the pipeline and store the zerocrossings, or anyother intermediate filters output, I get the No ImageIO set, or none could be created. The error is :</P>
<P>ITK Exception caught :<BR>itk::ExceptionObject (00FFE890)<BR>Location: "Unknown"<BR>File: D:\Jayant\MTP\ITK\InsightToolkit-1.6.0\Code\IO\itkImageFileWriter.txx<BR>Line: 143<BR>Description: itk::ERROR: ImageFileWriter(01622410): No ImageIO set, or none coul<BR>d be created.</P>
<P>My observer execution method is like follows :</P>
<P> m_observer->SetCallbackFunction( this, <BR> & firstFilter::GetContourAfterIteration );<BR> m_geodesic->AddObserver(itk::IterationEvent(), m_observer);<BR><BR>template <class TInputImage, class TInternalImage, class TOutputImage><BR>void firstFilter<TInputImage, TInternalImage, TOutputImage><BR>::GetContourAfterIteration(){<BR> <BR> static unsigned int iterationCounter = 0;</P>
<P> typedef itk::ImageFileWriter<TOutputImage> ImageWriter;<BR> typedef itk::RescaleIntensityImageFilter<TInternalImage,<BR> TOutputImage> CastFilterType;</P>
<P> ImageWriter::Pointer contour_writer = ImageWriter::New();<BR> <BR> CastFilterType::Pointer zerocastfilter = CastFilterType::New(); <BR> m_threshold->SetInput(m_geodesic->GetOutput()); <BR> <BR> // CastFilterType::Pointer zerocastfilter = CastFilterType::New();<BR> zerocastfilter->SetOutputMinimum(0);<BR> zerocastfilter->SetOutputMaximum(255);</P>
<P> std::cout<<"I am in the observer function"<<std::endl;</P>
<P> char* contourfile;<BR> contourfile = (char*)malloc(sizeof(char)*50);<BR> char* temp;<BR> temp = (char*)malloc(sizeof(char)*5);</P>
<P> int count = 0;<BR> if ( (iterationCounter != 0) && (iterationCounter%2 == 0) ){<BR> temp[0] = '\0';<BR> count = iterationCounter/10;<BR> if (count == 0)<BR> sprintf(temp,"%s%d","00",iterationCounter);<BR> else if (count < 10)<BR> sprintf(temp,"%s%d","0",iterationCounter);<BR> else<BR> sprintf(temp,"%s%d","",iterationCounter);</P>
<P> //sprintf(contourfile,"./contour/contour%s%s ",temp,".png");<BR> sprintf(contourfile,"%s","image.png");<BR> std::cout<<"Name is :"<<contourfile<<std::endl;<BR> std::cout << "No. elpased iterations: " << m_geodesic->GetElapsedIterations() << std::endl;<BR> std::cout << "RMS change: " << m_geodesic->GetRMSChange() << std::endl;<BR> contour_writer->SetFileName(contourfile);<BR> m_contour->SetInput(m_threshold->GetOutput());</P>
<P> zerocastfilter->SetInput(m_contour->GetOutput());<BR> contour_writer->SetInput(zerocastfilter->GetOutput());</P>
<P> try{<BR> std::cout<<"inside try of observer"<<std::endl;<BR> contour_writer->Update();<BR> }<BR> catch (itk::ExceptionObject & errr){<BR> std::cerr<<"ITK Exception caught :"<<errr<<std::endl;<BR> }<BR> <BR> }else{<BR> std::cout << "-----------No. elpased iterations: " << m_geodesic->GetElapsedIterations() << std::endl;<BR> std::cout << "-----------RMS change: " << m_geodesic->GetRMSChange() << std::endl;<BR> <BR> }<BR> <BR> iterationCounter++;<BR>}<BR><BR></P>
<P> </P>
<P>with regards</P>
<P>Jayant<BR></P></DIV>
<DIV></DIV>>From: Luis Ibanez <luis.ibanez@kitware.com>
<DIV></DIV>>To: Jayant Chauhan <gripened@hotmail.com>
<DIV></DIV>>CC: insight-users@itk.org
<DIV></DIV>>Subject: Re: [Insight-users] Urgenthelp with Observer class to store image sequence
<DIV></DIV>>Date: Thu, 13 May 2004 20:05:09 -0400
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Hi Jayant,
<DIV></DIV>>
<DIV></DIV>>The datapipeline will not execute in the order that
<DIV></DIV>>your organized your code. What matters is the topology
<DIV></DIV>>of the pipeline.
<DIV></DIV>>
<DIV></DIV>>If you have
<DIV></DIV>>
<DIV></DIV>> FilterB->SetInput( FilterA->GetOutput() );
<DIV></DIV>>
<DIV></DIV>>the FilterA will always execute before Filter B.
<DIV></DIV>>
<DIV></DIV>>What you should do is to draw your pipeline in a piece
<DIV></DIV>>of paper, like:
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>FilterA --> Filter B ---+
<DIV></DIV>> |
<DIV></DIV>> FilterQ -----> Output
<DIV></DIV>> |
<DIV></DIV>>FilterK --> Filter M ---+
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Then, simply follow the flow of data from the sources
<DIV></DIV>>to the consumers.
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Note that if you are running the pipeline several
<DIV></DIV>>times, only the filter that have any change in parameters
<DIV></DIV>>will be executed again, and will force the filters
<DIV></DIV>>downstream to execute too.
<DIV></DIV>>
<DIV></DIV>>---
<DIV></DIV>>
<DIV></DIV>>When you say that
<DIV></DIV>>
<DIV></DIV>> "I'm not able to get the Observer to work"
<DIV></DIV>>
<DIV></DIV>>what do you mean ?
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> A) it seg.faults ?
<DIV></DIV>> B) it throws exceptions ?
<DIV></DIV>> C) its Execute() method is not invoked ?
<DIV></DIV>> D) it prints always zero progress ?
<DIV></DIV>> C) it prints garbage .... ?
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Please be more precise,
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> Thanks
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> Luis
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>-----------------------
<DIV></DIV>>Jayant Chauhan wrote:
<DIV></DIV>>
<DIV></DIV>>>Hey Fellas,
<DIV></DIV>>> Seems I am a lil bit confused about the sequential flow of
<DIV></DIV>>>control in ITK.
<DIV></DIV>>> When I include all my image reading and filter executions in the
<DIV></DIV>>>main(), it works, but when I create a function which does all this
<DIV></DIV>>>as a member of my class, then I am not able to get the Observer to
<DIV></DIV>>>work. My code is as follows, I am using the
<DIV></DIV>>>GeodesicActiveContourLevelSetImageFilter to segment my image, and
<DIV></DIV>>>want to store all the contours, ie, the zerocrossing, so I add the
<DIV></DIV>>>observer to my zerocrossing filter,ie, m_contour.
<DIV></DIV>>> ALso it seems that only when I add my geodesicfilter to the
<DIV></DIV>>>observer are the contours stored and not when I add m_contour. ie.
<DIV></DIV>>> m_observer->SetCallbackFunction( this,
<DIV></DIV>>> & firstFilter::GetContourAfterIteration );
<DIV></DIV>>> *m_geodesic*->AddObserver(itk::IterationEvent(), m_observer);
<DIV></DIV>>>//works
<DIV></DIV>>> *m_contour*->AddObserver(itk::IterationEvent(), m_observer);
<DIV></DIV>>>//doesnt work
<DIV></DIV>>> my code:
<DIV></DIV>>> *_firstFilter.h_*
<DIV></DIV>>>*__* #ifndef _FIRST_FILTER_H
<DIV></DIV>>>#define _FIRST_FILTER_H
<DIV></DIV>>>#include "itkImage.h"
<DIV></DIV>>>#include "itkImageFileReader.h"
<DIV></DIV>>>#include "itkImageFileWriter.h"
<DIV></DIV>>>#include "itkGeodesicActiveContourLevelSetImageFilter.h"
<DIV></DIV>>>#include "itkCurvatureAnisotropicDiffusionImageFilter.h"
<DIV></DIV>>>#include "itkGradientMagnitudeRecursiveGaussianImageFilter.h"
<DIV></DIV>>>#include "itkSigmoidImageFilter.h"
<DIV></DIV>>>#include "itkBinaryThresholdImageFilter.h"
<DIV></DIV>>>#include "itkGeodesicActiveContourLevelSetFunction.h"
<DIV></DIV>>>#include "itkSegmentationLevelSetImageFilter.h"
<DIV></DIV>>>#include "itkCastImageFilter.h"
<DIV></DIV>>>#include "itkRescaleIntensityImageFilter.h"
<DIV></DIV>>>#include "itkZeroCrossingImageFilter.h"
<DIV></DIV>>>#include "itkCommand.h"
<DIV></DIV>>>#include "itkWeightedAddImageFilter.h"
<DIV></DIV>>>
<DIV></DIV>>>template <class TInputImage, class TInternalImage, class
<DIV></DIV>>>TOutputImage>
<DIV></DIV>>>class firstFilter{
<DIV></DIV>>> public:
<DIV></DIV>>> typedef
<DIV></DIV>>>itk::CurvatureAnisotropicDiffusionImageFilter<TInputImage,
<DIV></DIV>>> TInternalImage> SmoothingFilterType;
<DIV></DIV>>> typedef
<DIV></DIV>>>itk::GradientMagnitudeRecursiveGaussianImageFilter<TInternalImage,
<DIV></DIV>>> TInternalImage> GradientFilterType;
<DIV></DIV>>> typedef itk::SigmoidImageFilter<TInternalImage,
<DIV></DIV>>> TInternalImage> SigmoidFilterType;
<DIV></DIV>>> typedef
<DIV></DIV>>>itk::GeodesicActiveContourLevelSetImageFilter<TInternalImage,
<DIV></DIV>>> TInternalImage> GACFilterType;
<DIV></DIV>>> typedef itk::BinaryThresholdImageFilter<TInternalImage,
<DIV></DIV>>> TOutputImage> TFilterType;
<DIV></DIV>>> typedef itk::ZeroCrossingImageFilter<TOutputImage,
<DIV></DIV>>> TInternalImage> ZeroFilterType;
<DIV></DIV>>> typedef itk::WeightedAddImageFilter<TInternalImage,
<DIV></DIV>>> TInternalImage, TInternalImage> WAddFilterType;
<DIV></DIV>>> typedef itk::SimpleMemberCommand< firstFilter > ObserverType;
<DIV></DIV>>>
<DIV></DIV>>> SmoothingFilterType::Pointer m_smoothing;
<DIV></DIV>>> GradientFilterType::Pointer m_gradient;
<DIV></DIV>>> SigmoidFilterType::Pointer m_sigmoid;
<DIV></DIV>>> SmoothingFilterType::Pointer m_framesmoothing;
<DIV></DIV>>> GradientFilterType::Pointer m_framegradient;
<DIV></DIV>>> SigmoidFilterType::Pointer m_framesigmoid;
<DIV></DIV>>> GACFilterType::Pointer m_geodesic;
<DIV></DIV>>> TFilterType::Pointer m_threshold;
<DIV></DIV>>> ZeroFilterType::Pointer m_contour;
<DIV></DIV>>> WAddFilterType::Pointer m_wadd;
<DIV></DIV>>> ObserverType::Pointer m_observer;
<DIV></DIV>>> firstFilter();
<DIV></DIV>>> void ExecuteGAC(char* , char* , char* , char* , char* , char* ,
<DIV></DIV>>>char*,
<DIV></DIV>>> int , float , float , float ,
<DIV></DIV>>> float , float , float );
<DIV></DIV>>> void GetContourAfterIteration();
<DIV></DIV>>>};
<DIV></DIV>>>template <class TInputImage, class TInternalImage, class
<DIV></DIV>>>TOutputImage>
<DIV></DIV>>>void firstFilter<TInputImage, TInternalImage, TOutputImage>
<DIV></DIV>>>::ExecuteGAC(char* featureimage, char* frameimage, char*
<DIV></DIV>>>initlevelset,
<DIV></DIV>>> char* sigmoidresult, char* framesigmoidresult, char*
<DIV></DIV>>>gacresult, char* threshresult,
<DIV></DIV>>> int no_iter, float sigma, float alpha, float beta,
<DIV></DIV>>> float ascale, float cscale, float pscale){
<DIV></DIV>>> typedef itk::ImageFileReader<TInputImage> InputImageReader;
<DIV></DIV>>> typedef itk::ImageFileReader<TInternalImage> InternalImageReader;
<DIV></DIV>>> typedef itk::ImageFileWriter<TInternalImage>
<DIV></DIV>>>InternalImageWriter;
<DIV></DIV>>> typedef itk::ImageFileWriter<TOutputImage> OutputImageWriter;
<DIV></DIV>>> std::cout<<"I am inside the function "<<std::endl;
<DIV></DIV>>> InputImageReader::Pointer reader1 = InputImageReader::New();
<DIV></DIV>>> InputImageReader::Pointer reader2 = InputImageReader::New();
<DIV></DIV>>> InternalImageReader::Pointer internalreader1 =
<DIV></DIV>>>InternalImageReader::New();
<DIV></DIV>>> InternalImageWriter::Pointer internalwriter1 =
<DIV></DIV>>>InternalImageWriter::New();
<DIV></DIV>>> OutputImageWriter::Pointer sigmoidwriter =
<DIV></DIV>>>OutputImageWriter::New();
<DIV></DIV>>> OutputImageWriter::Pointer framesigmoidwriter =
<DIV></DIV>>>OutputImageWriter::New();
<DIV></DIV>>> OutputImageWriter::Pointer gacwriter = OutputImageWriter::New();
<DIV></DIV>>> OutputImageWriter::Pointer twriter = OutputImageWriter::New();
<DIV></DIV>>> reader1->SetFileName(featureimage);
<DIV></DIV>>> reader2->SetFileName(frameimage);
<DIV></DIV>>> internalreader1->SetFileName(initlevelset);
<DIV></DIV>>> sigmoidwriter->SetFileName(sigmoidresult);
<DIV></DIV>>> framesigmoidwriter->SetFileName(framesigmoidresult);
<DIV></DIV>>> m_smoothing->SetInput(reader1->GetOutput());
<DIV></DIV>>> m_framesmoothing->SetInput(reader2->GetOutput());
<DIV></DIV>>> m_gradient->SetSigma(sigma);
<DIV></DIV>>> m_gradient->SetInput(m_smoothing->GetOutput());
<DIV></DIV>>> m_framegradient->SetSigma(sigma);
<DIV></DIV>>> m_framegradient->SetInput(m_framesmoothing->GetOutput());
<DIV></DIV>>> m_sigmoid->SetInput(m_gradient->GetOutput());
<DIV></DIV>>> m_sigmoid->SetAlpha( alpha );
<DIV></DIV>>> m_sigmoid->SetBeta( beta );
<DIV></DIV>>> m_framesigmoid->SetInput(m_framegradient->GetOutput());
<DIV></DIV>>> m_framesigmoid->SetAlpha( alpha );
<DIV></DIV>>> m_framesigmoid->SetBeta( alpha );
<DIV></DIV>>> m_wadd->SetInput1(m_sigmoid->GetOutput());
<DIV></DIV>>> m_wadd->SetInput2(m_framesigmoid->GetOutput());
<DIV></DIV>>> m_geodesic->SetPropagationScaling( pscale );
<DIV></DIV>>> m_geodesic->SetCurvatureScaling( cscale );
<DIV></DIV>>> m_geodesic->SetAdvectionScaling( ascale );
<DIV></DIV>>> m_geodesic->SetMaximumRMSError(0.02);
<DIV></DIV>>> m_geodesic->SetNumberOfIterations( no_iter );
<DIV></DIV>>> m_geodesic->SetReverseExpansionDirection(false);
<DIV></DIV>>> m_geodesic->SetInput(internalreader1->GetOutput());
<DIV></DIV>>> m_geodesic->SetFeatureImage(m_wadd->GetOutput());
<DIV></DIV>>> gacwriter->SetFileName(gacresult);
<DIV></DIV>>> twriter->SetFileName(threshresult);
<DIV></DIV>>> m_threshold->SetInput(m_geodesic->GetOutput());
<DIV></DIV>>> typedef itk::RescaleIntensityImageFilter<TInternalImage,
<DIV></DIV>>> TOutputImage> CastFilterType;
<DIV></DIV>>> CastFilterType::Pointer sigmoidcastfilter =
<DIV></DIV>>>CastFilterType::New();
<DIV></DIV>>> CastFilterType::Pointer gaccastfilter = CastFilterType::New();
<DIV></DIV>>> sigmoidcastfilter->SetInput(m_sigmoid->GetOutput());
<DIV></DIV>>> gaccastfilter->SetInput(m_geodesic->GetOutput());
<DIV></DIV>>> sigmoidcastfilter->SetOutputMinimum(0);
<DIV></DIV>>> sigmoidcastfilter->SetOutputMaximum(255);
<DIV></DIV>>> gaccastfilter->SetOutputMinimum(0);
<DIV></DIV>>> gaccastfilter->SetOutputMaximum(255);
<DIV></DIV>>> sigmoidwriter->SetInput(sigmoidcastfilter->GetOutput());
<DIV></DIV>>> gacwriter->SetInput(gaccastfilter->GetOutput());
<DIV></DIV>>> twriter->SetInput(m_threshold->GetOutput());
<DIV></DIV>>> CastFilterType::Pointer zerocastfilter = CastFilterType::New();
<DIV></DIV>>> zerocastfilter->SetOutputMinimum(0);
<DIV></DIV>>> zerocastfilter->SetOutputMaximum(255);
<DIV></DIV>>> OutputImageWriter::Pointer zcwriter = OutputImageWriter::New();
<DIV></DIV>>> m_contour->SetInput(m_threshold->GetOutput());
<DIV></DIV>>> zerocastfilter->SetInput(m_contour->GetOutput());
<DIV></DIV>>> zcwriter->SetFileName("zerocrossing.png");
<DIV></DIV>>> zcwriter->SetInput(zerocastfilter->GetOutput());
<DIV></DIV>>> try{
<DIV></DIV>>> gacwriter->Update();
<DIV></DIV>>> twriter->Update();
<DIV></DIV>>> sigmoidwriter->Update();
<DIV></DIV>>> zcwriter->Update();
<DIV></DIV>>> }
<DIV></DIV>>> catch (itk::ExceptionObject & err)
<DIV></DIV>>> {
<DIV></DIV>>> std::cerr<<"Exception caught "<<std::endl;
<DIV></DIV>>> std::cerr<<err<<std::endl;
<DIV></DIV>>> }
<DIV></DIV>>>
<DIV></DIV>>>}
<DIV></DIV>>>
<DIV></DIV>>>template <class TInputImage, class TInternalImage, class
<DIV></DIV>>>TOutputImage>
<DIV></DIV>>>void firstFilter<TInputImage, TInternalImage, TOutputImage>
<DIV></DIV>>>::GetContourAfterIteration(){
<DIV></DIV>>> static unsigned int iterationCounter = 0;
<DIV></DIV>>> std::cout<<"Hey do I get a change "<<std::endl;
<DIV></DIV>>> typedef itk::ImageFileWriter<TOutputImage> ImageWriter;
<DIV></DIV>>> typedef itk::RescaleIntensityImageFilter<TInternalImage,
<DIV></DIV>>> TOutputImage> CastFilterType;
<DIV></DIV>>> ImageWriter::Pointer contour_writer = ImageWriter::New();
<DIV></DIV>>> CastFilterType::Pointer zccast = CastFilterType::New();
<DIV></DIV>>> zccast->SetOutputMinimum(0);
<DIV></DIV>>> zccast->SetOutputMaximum(255);
<DIV></DIV>>>
<DIV></DIV>>> char* contourfile;
<DIV></DIV>>> contourfile = (char*)malloc(sizeof(char)*50);
<DIV></DIV>>> if ( (iterationCounter != 0) && (iterationCounter%25 == 0) ){
<DIV></DIV>>> sprintf(contourfile,"%d%s",iterationCounter,".png");
<DIV></DIV>>> std::cout << "No. elpased iterations: " <<
<DIV></DIV>>>m_geodesic->GetElapsedIterations() << std::endl;
<DIV></DIV>>> std::cout << "RMS change: " << m_geodesic->GetRMSChange() <<
<DIV></DIV>>>std::endl;
<DIV></DIV>>> contour_writer->SetFileName(contourfile);
<DIV></DIV>>> zccast->SetInput(m_contour->GetOutput());
<DIV></DIV>>> contour_writer->SetInput(zccast->GetOutput());
<DIV></DIV>>> try{
<DIV></DIV>>> contour_writer->Update();
<DIV></DIV>>> }
<DIV></DIV>>> catch (itk::ExceptionObject & err){
<DIV></DIV>>> std::cerr<<"ITK Exception caught :"<<err<<std::endl;
<DIV></DIV>>> }
<DIV></DIV>>> }
<DIV></DIV>>> else{
<DIV></DIV>>> std::cout<<"Iteration counter :"<<iterationCounter<<std::endl;
<DIV></DIV>>> }
<DIV></DIV>>> iterationCounter++;
<DIV></DIV>>>}
<DIV></DIV>>>
<DIV></DIV>>>template <class TInputImage, class TInternalImage, class
<DIV></DIV>>>TOutputImage>
<DIV></DIV>>>firstFilter<TInputImage, TInternalImage, TOutputImage>
<DIV></DIV>>>::firstFilter(){
<DIV></DIV>>> m_smoothing = SmoothingFilterType::New();
<DIV></DIV>>> m_framesmoothing = SmoothingFilterType::New();
<DIV></DIV>>> m_smoothing->SetTimeStep(0.125);
<DIV></DIV>>> m_smoothing->SetNumberOfIterations(5);
<DIV></DIV>>> m_smoothing->SetConductanceParameter(3.0);
<DIV></DIV>>> m_framesmoothing->SetTimeStep(0.125);
<DIV></DIV>>> m_framesmoothing->SetNumberOfIterations(5);
<DIV></DIV>>> m_framesmoothing->SetConductanceParameter(3.0);
<DIV></DIV>>> m_gradient = GradientFilterType::New();
<DIV></DIV>>> m_framegradient = GradientFilterType::New();
<DIV></DIV>>> m_sigmoid = SigmoidFilterType::New();
<DIV></DIV>>> m_framesigmoid = SigmoidFilterType::New();
<DIV></DIV>>> m_sigmoid->SetOutputMinimum(0.0);
<DIV></DIV>>> m_sigmoid->SetOutputMaximum(1.0);
<DIV></DIV>>> m_framesigmoid->SetOutputMinimum(0.0);
<DIV></DIV>>> m_framesigmoid->SetOutputMaximum(1.0);
<DIV></DIV>>> m_wadd = WAddFilterType::New();
<DIV></DIV>>> m_wadd->SetAlpha(0.5);
<DIV></DIV>>> m_geodesic = GACFilterType::New();
<DIV></DIV>>> m_geodesic->SetIsoSurfaceValue(127.0);
<DIV></DIV>>> m_threshold = TFilterType::New();
<DIV></DIV>>> m_threshold->SetLowerThreshold(-1000.0);
<DIV></DIV>>> m_threshold->SetUpperThreshold(0.0);
<DIV></DIV>>> m_threshold->SetOutsideValue(0);
<DIV></DIV>>> m_threshold->SetInsideValue(255);
<DIV></DIV>>> m_contour = ZeroFilterType::New();
<DIV></DIV>>> m_observer = ObserverType::New();
<DIV></DIV>>> m_observer->SetCallbackFunction( this,
<DIV></DIV>>> & firstFilter::GetContourAfterIteration );
<DIV></DIV>>> m_geodesic->AddObserver(itk::IterationEvent(), m_observer);
<DIV></DIV>>>}
<DIV></DIV>>> #endif
<DIV></DIV>>>
<DIV></DIV>>>--------------------------------------------------------------------------------------------------------------
<DIV></DIV>>> *_firstFilter.cxx_*
<DIV></DIV>>>#include "firstFilter.h"
<DIV></DIV>>>int main(int argc, char** argv){
<DIV></DIV>>> typedef unsigned char InputPixelType;
<DIV></DIV>>> typedef float InternalPixelType;
<DIV></DIV>>> typedef unsigned char OutputPixelType;
<DIV></DIV>>> typedef itk::Image<InputPixelType, 2> InputImageType;
<DIV></DIV>>> typedef itk::Image<InternalPixelType, 2> InternalImageType;
<DIV></DIV>>> typedef itk::Image<OutputPixelType, 2> OutputImageType;
<DIV></DIV>>> typedef itk::ImageFileReader<InputImageType> InputImageReader;
<DIV></DIV>>> typedef itk::ImageFileReader<InternalImageType>
<DIV></DIV>>>InternalImageReader;
<DIV></DIV>>> typedef itk::ImageFileWriter<InternalImageType>
<DIV></DIV>>>InternalImageWriter;
<DIV></DIV>>> typedef itk::ImageFileWriter<OutputImageType> OutputImageWriter;
<DIV></DIV>>> if (argc < 15){
<DIV></DIV>>> std::cerr<<"Incorrect usage, Correct usage being : "<<std::endl;
<DIV></DIV>>> std::cerr<<"firstFilter.exe FeatureImage FrameImage
<DIV></DIV>>>InitialLevelSetImage ";
<DIV></DIV>>> std::cerr<<"sigmoidresult framesigmoidresult geodesicresult
<DIV></DIV>>>thresholdresult ";
<DIV></DIV>>> std::cerr<<"NoOfIterations sigma alpha beta pscale cscale
<DIV></DIV>>>ascale ";
<DIV></DIV>>> std::cerr<<"--------------"<<std::endl;
<DIV></DIV>>> exit(1);
<DIV></DIV>>> }
<DIV></DIV>>> firstFilter<InputImageType, InternalImageType, OutputImageType>
<DIV></DIV>>>ff;
<DIV></DIV>>> ff.ExecuteGAC(argv[1], argv[2], argv[3], argv[4], argv[5],
<DIV></DIV>>>argv[6], argv[7], atoi(argv[8]),
<DIV></DIV>>> atof(argv[9]), atof(argv[10]), atof(argv[11]),
<DIV></DIV>>>atof(argv[12]), atof(argv[13]),
<DIV></DIV>>> atof(argv[14])) ;
<DIV></DIV>>>
<DIV></DIV>>> return 1;
<DIV></DIV>>>}
<DIV></DIV>>>----------------------------------------------------------------------------------------------------------
<DIV></DIV>>> Any suggestions please, have to finish this asap
<DIV></DIV>>> with regards
<DIV></DIV>>> Jayant
<DIV></DIV>>>
<DIV></DIV>>>------------------------------------------------------------------------
<DIV></DIV>>>Send flowers in 24 hours! At MSN Shopping.
<DIV></DIV>>><http://g.msn.com/8HMAENIN/2743??PS=47575>
<DIV></DIV>>>_______________________________________________ Insight-users
<DIV></DIV>>>mailing list Insight-users@itk.org
<DIV></DIV>>>http://www.itk.org/mailman/listinfo/insight-users
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV></div><br clear=all><hr>Let your desktop sizzle! Get the hottest wallpapers. <a href="http://g.msn.com/8HMBENIN/2755??PS=47575">Right here at MSN Entertainment!</a> </html>
More information about the Insight-users
mailing list