mAlpha = 0.6;
mImage = 0;
mSlicer = 0;
- mColorLUT = vtkLookupTable::New();
+ mColorLUT = vtkSmartPointer<vtkLookupTable>::New();
mForegroundValue = 1;
mBackgroundValue = 0;
m_modeBG = true;
for (unsigned int i = 0; i < mSlicer->GetImage()->GetVTKImages().size(); i++) {
mSlicer->GetRenderer()->RemoveActor(mImageActorList[i]);
}
- mImageActorList.clear();
mMapperList.clear();
+ mImageActorList.clear();
}
//------------------------------------------------------------------------------
// Create an actor for each time slice
for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
// how many intensity ?
- vtkImageMapToRGBA * mOverlayMapper = vtkImageMapToRGBA::New();
+ vtkSmartPointer<vtkImageMapToRGBA> mOverlayMapper = vtkSmartPointer<vtkImageMapToRGBA>::New();
mOverlayMapper->SetInput(mImage->GetVTKImages()[0]); // DS TODO : to change if it is 4D !!!
double range[2];
mOverlayMapper->SetLookupTable(mColorLUT);
- vtkImageActor * mOverlayActor = vtkImageActor::New();
+ vtkSmartPointer<vtkImageActor> mOverlayActor = vtkSmartPointer<vtkImageActor>::New();
mOverlayActor->SetInput(mOverlayMapper->GetOutput());
mOverlayActor->SetPickable(0);
mOverlayActor->SetVisibility(IsVisible);
//------------------------------------------------------------------------------
-void vvBinaryImageOverlayActor::SetImage(vvImage::Pointer image, double bg, bool modeBG)
+void vvBinaryImageOverlayActor::SetImage(vvImage * image, double bg, bool modeBG)
{
mImage = image;
if (modeBG) {
void SetSlicer(vvSlicer * slicer);
void SetColor(double r, double g, double b);
void SetOpacity(double d);
- void SetImage(vvImage::Pointer image, double bg, bool modeBG=true);
+ void SetImage(vvImage * image, double bg, bool modeBG=true);
void Initialize(bool IsVisible=true);
void UpdateColor();
void UpdateSlice(int slicer, int slice);
int mTSlice;
int mPreviousTSlice;
int mPreviousSlice;
- vvImage::Pointer mImage;
+ vvImage * mImage;
std::vector<double> mColor;
double mAlpha;
double mBackgroundValue;
double mForegroundValue;
bool m_modeBG;
- vtkLookupTable * mColorLUT;
+ vtkSmartPointer<vtkLookupTable> mColorLUT;
- std::vector<vtkImageMapToRGBA *> mMapperList;
- std::vector<vtkImageActor*> mImageActorList;
+ std::vector<vtkSmartPointer<vtkImageMapToRGBA> > mMapperList;
+ std::vector<vtkSmartPointer<vtkImageActor> > mImageActorList;
void ComputeExtent(int orientation,
int slice,
for (unsigned int i = 0; i < mSlicer->GetImage()->GetVTKImages().size(); i++) {
mSlicer->GetRenderer()->RemoveActor(mSquaresActorList[i]);
}
- mSquaresActorList.clear();
- mSquaresList.clear();
- mClipperList.clear();
+ mSquaresActorList.clear();
+ mSquaresList.clear();
+ mClipperList.clear();
}
//------------------------------------------------------------------------------
mSlicer = slicer;
// Create an actor for each time slice
for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
- vtkImageClip * mClipper = vtkImageClip::New();
- vtkMarchingSquares * mSquares = vtkMarchingSquares::New();
- vtkActor * mSquaresActor = vtkActor::New();
+ vtkImageClip * mClipper;// = vtkImageClip::New();
+ vtkMarchingSquares * mSquares;// = vtkMarchingSquares::New();
+ vtkActor * mSquaresActor;// = vtkActor::New();
CreateNewActor(&mSquaresActor, &mSquares, &mClipper, numImage);
mSquaresActorList.push_back(mSquaresActor);
mSquaresList.push_back(mSquares);
//------------------------------------------------------------------------------
-void vvImageContour::SetImage(vvImage::Pointer image) {
+void vvImageContour::SetImage(vvImage * image) {
for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) {
mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]);
}
//------------------------------------------------------------------------------
void vvImageContour::InitializeCacheMode() {
+clitkExceptionMacro("TODO : not implemented yet");
mPreviousSlice = mPreviousOrientation = 0;
int dim = mSlicer->GetImage()->GetNumberOfDimensions();
//------------------------------------------------------------------------------
void vvImageContour::UpdateWithFastCacheMode() {
+clitkExceptionMacro("TODO : not implemented yet");
+
// Compute orientation
int orientation = ComputeCurrentOrientation();
vtkMarchingSquares ** squares,
vtkImageClip ** clipper,
int numImage) {
- vtkActor * mSquaresActor = (*actor = vtkActor::New());
- vtkImageClip * mClipper = (*clipper = vtkImageClip::New());
- vtkMarchingSquares * mSquares = (*squares = vtkMarchingSquares::New());
- vtkPolyDataMapper * mSquaresMapper = vtkPolyDataMapper::New();
+ vtkSmartPointer<vtkActor> mSquaresActor = (*actor = vtkSmartPointer<vtkActor>::New());
+ vtkSmartPointer<vtkImageClip> mClipper = (*clipper = vtkSmartPointer<vtkImageClip>::New());
+ vtkSmartPointer<vtkMarchingSquares> mSquares = (*squares = vtkSmartPointer<vtkMarchingSquares>::New());
+ vtkSmartPointer<vtkPolyDataMapper> mSquaresMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
if (mHiddenImageIsUsed)
mClipper->SetInput(mHiddenImage->GetVTKImages()[0]);
void ShowActors();
void SetColor(double r, double g, double b);
void SetLineWidth(double w);
- void SetImage(vvImage::Pointer image);
+ void SetImage(vvImage * image);
void SetPreserveMemoryModeEnabled(bool b);
protected:
int mPreviousTSlice;
double mPreviousValue;
bool mHiddenImageIsUsed;
- vvImage::Pointer mHiddenImage;
+ vvImage * mHiddenImage;
bool mDisplayModeIsPreserveMemory;
// For preserveMemory mode
- std::vector<vtkImageClip*> mClipperList;
- std::vector<vtkMarchingSquares*> mSquaresList;
- std::vector<vtkActor*> mSquaresActorList;
+ std::vector<vtkSmartPointer<vtkImageClip> > mClipperList;
+ std::vector<vtkSmartPointer<vtkMarchingSquares> > mSquaresList;
+ std::vector<vtkSmartPointer<vtkActor> > mSquaresActorList;
// For fast cache mode
int mPreviousSlice;
void UpdateWithFastCacheMode();
void CreateNewActor(vtkActor ** actor,
vtkMarchingSquares ** squares,
- vtkImageClip ** clipper, int numImage);
+ vtkImageClip ** clipper,
+ int numImage);
void UpdateActor(vtkActor * actor,
vtkMarchingSquares * squares,
vtkImageClip * clipper,