<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Dear All:</DIV>
<DIV> </DIV>
<DIV>I am trying to wirte some template class which is templated over itkImage with following class defintion. At this time, I just want my code to do somework with the help of itk tools. But something is wrong with my constructor an deconstructoer although I did not do anything using them now.</DIV>
<DIV> </DIV>
<DIV>The error message shows me I should not call itkImage constructor or destructor since they are protected. Can somebody tell me the right way to do the work.</DIV>
<DIV> </DIV>
<DIV>I have listed the code and error message.</DIV>
<DIV> </DIV>
<DIV>Thanks and my best regards</DIV>
<DIV> </DIV>
<DIV>Baoyun</DIV>
<DIV> </DIV>
<DIV>1. The intilization of this class</DIV>
<DIV> </DIV>
<DIV> typedef ChanVese<InputImageType,InputImageType,float> ChanVeseType;<BR> ChanVeseType leveset1;</DIV>
<DIV> </DIV>
<DIV>2: class definition</DIV>
<DIV>***************************************************</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>#ifndef _ChanVese_H<BR>#define _ChanVese_H</DIV>
<DIV> </DIV>
<DIV><BR>#include "itkImage.h"<BR>#include "itkImageFileReader.h"<BR>#include "itkImageFileWriter.h"<BR>#include "itkBinaryThresholdImageFilter.h"</DIV>
<DIV><BR>using namespace std;<BR>template <class TInputImage,class TFeatureImage,class TOutputPixelType><BR> class ChanVese</DIV>
<DIV>{<BR> <BR> <BR> <BR> public:<BR> itkStaticConstMacro( ImageDimension, unsigned int,TInputImage::ImageDimension );<BR> typedef TFeatureImage FeatureImageType;<BR> typedef typename FeatureImageType::PixelType FeaturePixelType;</DIV>
<DIV> typedef TInputImage InputImageType;<BR> typedef typename InputImageType::PixelType InputPixelType;</DIV>
<DIV> ChanVese()</DIV>
<DIV> {<BR> std::cout<<"chan vesee desconstructed"<<std::endl;<BR> }<BR> ~ChanVese()</DIV>
<DIV> {<BR> std::cout<<"chan vesee desconstructed"<<std::endl;<BR> }<BR> <BR> } ;</DIV>
<DIV><BR>#endif</DIV>
<DIV> </DIV>
<DIV>******************************************************</DIV>
<DIV> </DIV>
<DIV>
<DIV>--------------------------------------------------------------------------------------------------</DIV>
<DIV>/home/gtao/tools/ITK/source_3.16/Code/Common/itkImage.txx:34: error: 'itk::Image<TPixel, VImageDimension>::Image() [with TPixel = short int, unsigned int VImageDimension = 3u]' is protected<BR>/home/gtao/code/Gui_Segmenation/chan_vesse/v1.5_tumor_pdfmap/source/algorithm/ChanVese.h:35: error: within this context<BR>/home/gtao/code/Gui_Segmenation/chan_vesse/v1.5_tumor_pdfmap/source/test.cxx:490: instantiated from here<BR>/home/gtao/tools/ITK/source_3.16/Code/Common/itkImage.h:287: error: 'itk::Image<TPixel, VImageDimension>::~Image() [with TPixel = short int, unsigned int VImageDimension = 3u]' is protected<BR>/home/gtao/code/Gui_Segmenation/chan_vesse/v1.5_tumor_pdfmap/source/algorithm/ChanVese.h:35: error: within this context<BR>/home/gtao/tools/ITK/source_3.16/Code/Common/itkImage.h: In destructor 'ChanVese<TInputImage, TFeatureImage, TOutputPixelType>::~ChanVese() [with TInputImage = itk::Image<short int, 3u>,
TFeatureImage = itk::Image<short int, 3u>, TOutputPixelType = float]':<BR>/home/gtao/code/Gui_Segmenation/chan_vesse/v1.5_tumor_pdfmap/source/test.cxx:490: instantiated from here<BR>/home/gtao/tools/ITK/source_3.16/Code/Common/itkImage.h:287: error: 'itk::Image<TPixel, VImageDimension>::~Image() [with TPixel = short int, unsigned int VImageDimension = 3u]' is protected<BR>/home/gtao/code/Gui_Segmenation/chan_vesse/v1.5_tumor_pdfmap/source/algorithm/ChanVese.h:42: error: within this context<BR></DIV>
<DIV>------------------------------------------------------------------------------------------------------</DIV>
<DIV> </DIV></DIV>
<DIV> </DIV></div><br>
</body></html>