//------------------------------------------------------------------------------
vvSlicer::vvSlicer()
{
+ this->UnInstallPipeline();
mImage = NULL;
mCurrentTSlice = 0;
mUseReducedExtent = false;
text += "middle button : grab image\n";
text += "right button : change windowing\n";
- crossCursor = vtkCursor2D::New();
+ crossCursor = vtkSmartPointer<vtkCursor2D>::New();
crossCursor->AllOff();
crossCursor->AxesOn();
crossCursor->SetTranslationMode(1);
crossCursor->SetRadius(2);
- pdm = vtkPolyDataMapper2D::New();
+ pdm = vtkSmartPointer<vtkPolyDataMapper2D>::New();
pdm->SetInput(crossCursor->GetOutput());
- pdmA = vtkActor2D::New();
+ pdmA = vtkSmartPointer<vtkActor2D>::New();
pdmA->SetMapper(pdm);
pdmA->GetProperty()->SetColor(255,10,212);
pdmA->SetVisibility(0);
pdmA->SetPickable(0);
- ca = vtkCornerAnnotation::New();
+ ca = vtkSmartPointer<vtkCornerAnnotation>::New();
ca->GetTextProperty()->SetColor(255,10,212);
ca->SetVisibility(1);
mFileName = "";
this->WindowLevel->Delete();
this->WindowLevel = vvImageMapToWLColors::New();
- this->InstallPipeline();
+ this->InstallPipeline();
}
//------------------------------------------------------------------------------
mOverlay = overlay;
if (!mOverlayMapper)
- mOverlayMapper = vtkImageMapToWindowLevelColors::New();
+ mOverlayMapper = vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();
mOverlayMapper->SetInput(overlay->GetVTKImages()[0]);
if (!mOverlayActor) {
- mOverlayActor = vvBlendImageActor::New();
+ mOverlayActor = vtkSmartPointer<vvBlendImageActor>::New();
mOverlayActor->SetInput(mOverlayMapper->GetOutput());
mOverlayActor->SetPickable(0);
mOverlayActor->SetVisibility(false);
mFusion = fusion;
if (!mFusionMapper)
- mFusionMapper = vtkImageMapToWindowLevelColors::New();
+ mFusionMapper = vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();
mFusionMapper->SetInput(fusion->GetVTKImages()[0]);
if (!mFusionActor) {
- mFusionActor = vtkImageActor::New();
+ mFusionActor = vtkSmartPointer<vtkImageActor>::New();
mFusionActor->SetInput(mFusionMapper->GetOutput());
mFusionActor->SetPickable(0);
mFusionActor->SetVisibility(false);
mVF = vf;
if (!mAAFilter) {
- mAAFilter=vtkAssignAttribute::New();
- mVOIFilter = vtkExtractVOI::New();
+ mAAFilter= vtkSmartPointer<vtkAssignAttribute>::New();
+ mVOIFilter = vtkSmartPointer<vtkExtractVOI>::New();
mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
}
mVOIFilter->SetInput(vf->GetVTKImages()[0]);
mAAFilter->Assign(vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);
if (!mArrow)
- mArrow = vvGlyphSource::New();
+ mArrow = vtkSmartPointer<vvGlyphSource>::New();
mArrow->SetGlyphTypeToSpecificArrow();
mArrow->SetScale(mScale);
mArrow->FilledOff();
// Glyph the gradient vector (with arrows)
if (!mGlyphFilter)
- mGlyphFilter = vvGlyph2D::New();
+ mGlyphFilter = vtkSmartPointer<vvGlyph2D>::New();
mGlyphFilter->SetInput(mAAFilter->GetOutput());
mGlyphFilter->SetSource(mArrow->GetOutput());
mGlyphFilter->ScalingOn();
mGlyphFilter->SetColorModeToColorByVector();
if (!mVFMapper)
- mVFMapper = vtkPolyDataMapper::New();
+ mVFMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
//mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort());
mVFMapper->SetInput(mGlyphFilter->GetOutput());
mVFMapper->ImmediateModeRenderingOn();
if (!mVFActor)
- mVFActor = vtkActor::New();
+ mVFActor = vtkSmartPointer<vtkActor>::New();
mVFActor->SetMapper(mVFMapper);
mVFActor->SetPickable(0);
mVFActor->GetProperty()->SetLineWidth(mVFWidth);
if (landmarks) {
if (!mCross)
- mCross = vtkCursor3D::New();
+ mCross = vtkSmartPointer<vtkCursor3D>::New();
mCross->SetFocalPoint(0.0,0.0,0.0);
mCross->SetModelBounds(-10,10,-10,10,-10,10);
mCross->AllOff();
mCross->AxesOn();
if (!mLandGlyph)
- mLandGlyph = vtkGlyph3D::New();
+ mLandGlyph = vtkSmartPointer<vtkGlyph3D>::New();
mLandGlyph->SetSource(mCross->GetOutput());
mLandGlyph->SetInput(landmarks->GetOutput());
//mLandGlyph->SetIndexModeToScalar();
mLandGlyph->SetColorModeToColorByScalar();
if (!mClipBox)
- mClipBox = vtkBox::New();
+ mClipBox = vtkSmartPointer<vtkBox>::New();
if (!mLandClipper)
- mLandClipper = vtkClipPolyData::New();
+ mLandClipper = vtkSmartPointer<vtkClipPolyData>::New();
mLandClipper->InsideOutOn();
mLandClipper->SetInput(mLandGlyph->GetOutput());
mLandClipper->SetClipFunction(mClipBox);
if (!mLandMapper)
- mLandMapper = vtkPolyDataMapper::New();
+ mLandMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mLandMapper->SetInputConnection(mLandClipper->GetOutputPort());
//mLandMapper->ScalarVisibilityOff();
if (!mLandActor)
- mLandActor = vtkActor::New();
+ mLandActor = vtkSmartPointer<vtkActor>::New();
mLandActor->SetMapper(mLandMapper);
mLandActor->GetProperty()->SetColor(255,10,212);
mLandActor->SetPickable(0);
std::swap(iLocalExtents[i*2], iLocalExtents[i*2+1]);
}
- vtkSmartPointer<vtkExtractVOI> voiFilter = vtkExtractVOI::New();
+ vtkSmartPointer<vtkExtractVOI> voiFilter = vtkSmartPointer<vtkExtractVOI>::New();
voiFilter->SetInput(this->GetInput());
voiFilter->SetVOI(iLocalExtents);
voiFilter->Update();
return;
}
- vtkSmartPointer<vtkImageAccumulate> accFilter = vtkImageAccumulate::New();
+ vtkSmartPointer<vtkImageAccumulate> accFilter = vtkSmartPointer<vtkImageAccumulate>::New();
accFilter->SetInput(voiFilter->GetOutput());
accFilter->Update();