if (mROI->GetImage()) {
mImageContour.clear();
mOverlayActors.clear();
- for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
mImageContour.push_back(new vvImageContour);
mImageContour[i]->SetSlicer(mSlicerManager->GetSlicer(i));
mImageContour[i]->SetImage(mROI->GetImage());
//------------------------------------------------------------------------------
void vvROIActor::Update()
{
- for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
UpdateSlice(i, mSlicerManager->GetSlicer(i)->GetSlice());
}
}
{
mIsSelected = b;
if (b) {
- for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
mImageContour[i]->SetLineWidth(3.0);
mImageContour[i]->ShowActors();
}
} else {
- for(int i=0; i<mSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mSlicerManager->GetNumberOfSlicers(); i++) {
mImageContour[i]->HideActors();
}
}
mClipBox->SetBounds(bounds);
UpdateLandmarks();
}
- // DD(mLandActor->GetPosition()[2]);
- // DD(Renderer->GetActiveCamera()->GetPosition()[2]);
mLandActor->SetPosition(0,0,-1.5);
/*
if (Renderer->GetActiveCamera()->GetPosition()[2] > this->Slice)
mClipBox->SetBounds(bounds);
UpdateLandmarks();
}
- // DD(mLandActor->GetPosition()[1]);
- //DD(Renderer->GetActiveCamera()->GetPosition()[1]);
if (Renderer->GetActiveCamera()->GetPosition()[1] > this->Slice)
mLandActor->SetPosition(0,1.5,0);
else
mClipBox->SetBounds(bounds);
UpdateLandmarks();
}
- // DD(mLandActor->GetPosition()[1]);
- // DD(Renderer->GetActiveCamera()->GetPosition()[1]);
if (Renderer->GetActiveCamera()->GetPosition()[0] > this->Slice)
mLandActor->SetPosition(1.5,0,0);
else
-
-
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+ ======================================================================-====*/
#ifndef __vvSlicer_h
#define __vvSlicer_h
#include <iostream>
#include "vvLandmarks.h"
#include "vvImage.h"
-#include "vtkImageViewer2.h"
#include "vvMesh.h"
-#include <vvMeshActor.h>
+#include "vvMeshActor.h"
+
#include <vtkSmartPointer.h>
+#include <vtkImageViewer2.h>
class vtkActor;
class vtkActor2D;
class vvSlicer: public vtkImageViewer2
{
public:
- static vvSlicer *New();
- vtkTypeRevisionMacro(vvSlicer,vtkImageViewer2);
- void PrintSelf(ostream& os, vtkIndent indent);
-
- void SetImage(vvImage::Pointer inputImages);
- vvImage::Pointer GetImage() {
- return mImage;
- }
-
- void SetOverlay(vvImage::Pointer inputOverlay);
- vvImage::Pointer GetOverlay() {
- return mOverlay;
- }
-
- vtkImageMapToWindowLevelColors* GetOverlayMapper();
- vvBlendImageActor* GetOverlayActor() ;
- vtkImageMapToWindowLevelColors* GetFusionMapper() ;
- vtkImageActor* GetFusionActor() ;
- vtkActor* GetVFActor() ;
- vtkCornerAnnotation* GetAnnotation();
+ static vvSlicer *New();
+ vtkTypeRevisionMacro(vvSlicer,vtkImageViewer2);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ void SetImage(vvImage::Pointer inputImages);
+ vvImage::Pointer GetImage() {
+ return mImage;
+ }
+
+ void SetOverlay(vvImage::Pointer inputOverlay);
+ vvImage::Pointer GetOverlay() {
+ return mOverlay;
+ }
+ vtkImageMapToWindowLevelColors* GetOverlayMapper();
+ vvBlendImageActor* GetOverlayActor() ;
+ vtkImageMapToWindowLevelColors* GetFusionMapper() ;
+ vtkImageActor* GetFusionActor() ;
+ vtkActor* GetVFActor() ;
+ vtkCornerAnnotation* GetAnnotation();
- void SetFusion(vvImage::Pointer inputFusion);
- vvImage::Pointer GetFusion() {
- return mFusion;
- }
-
- /**Set an actor's visibility ("overlay, fusion, vf, contour...")
- Overlay index is the index of the overlay by type, eg. if there are
- 5 contours and we want to activate the 3rd one, pass 2 **/
- void SetActorVisibility(const std::string& actor_type, int overlay_index,bool vis);
- void RemoveActor(const std::string& actor_type, int overlay_index);
-
- void SetVF(vvImage::Pointer vf);
- vvImage *GetVF() {
- return mVF;
- }
-
- void SetLandmarks(vvLandmarks* landmarks);
- void SetTSlice(int t);
- void SetSliceOrientation(int orientation);
- int GetTSlice();
- ///Reimplemented from vtkImageViewer2 to add polydata support
- void SetSlice(int s);
- int GetTMax() {
- return (unsigned int)mImage->GetVTKImages().size() - 1;
- }
-
- void SetOpacity(double s);
- void SetRenderWindow(int orientation, vtkRenderWindow * rw);
- void SetDisplayMode(bool i);
- void FlipHorizontalView();
- void FlipVerticalView();
- void Render();
- ///Sets the camera to fit the image in the window
- void ResetCamera();
-
- void SetVFSubSampling(int sub);
- int GetVFSubSampling() {
- return mSubSampling;
- }
- void SetVFScale(int scale);
- void SetVFWidth(int width);
- int GetVFScale() {
- return mScale;
- }
- void SetVFLog(int log);
- int GetVFLog() {
- return mVFLog;
- }
-
- void SetFileName(std::string filename) {
- mFileName = filename;
- }
- std::string GetFileName() {
- return mFileName;
- }
-
- double* GetCursorPosition() {
- return mCursor;
- }
-
- void SetCurrentPosition(double x, double y, double z, int t);
- double* GetCurrentPosition() {
- return mCurrent;
- }
-
- void UpdateCursorPosition();
- void SetCursorVisibility(bool s);
- bool GetCursorVisibility();
- void SetCursorColor(int r,int g, int b);
-
- void GetExtremasAroundMousePointer(double & min, double & max);
-
- void UpdateLandmarks();
- void ForceUpdateDisplayExtent();
-
- int* GetDisplayExtent();
- /**Add a polydata to be displayed as a contour over the image
- ** the contour can be propagated to a time sequence using a motion field */
- void AddContour(vvMesh::Pointer contours,bool propagate);
- ///Toggle temporal superposition of contours
- void ToggleContourSuperposition();
-
- virtual void SetColorWindow(double s);
- virtual void SetColorLevel(double s);
+ void SetFusion(vvImage::Pointer inputFusion);
+ vvImage::Pointer GetFusion() {
+ return mFusion;
+ }
+
+ /**Set an actor's visibility ("overlay, fusion, vf, contour...")
+ Overlay index is the index of the overlay by type, eg. if there are
+ 5 contours and we want to activate the 3rd one, pass 2 **/
+ void SetActorVisibility(const std::string& actor_type, int overlay_index,bool vis);
+ void RemoveActor(const std::string& actor_type, int overlay_index);
+
+ void SetVF(vvImage::Pointer vf);
+ vvImage *GetVF() {
+ return mVF;
+ }
+
+ void SetLandmarks(vvLandmarks* landmarks);
+ void SetTSlice(int t);
+ void SetSliceOrientation(int orientation);
+ int GetTSlice();
+ ///Reimplemented from vtkImageViewer2 to add polydata support
+ void SetSlice(int s);
+ int GetTMax() {
+ return (unsigned int)mImage->GetVTKImages().size() - 1;
+ }
+
+ void SetOpacity(double s);
+ void SetRenderWindow(int orientation, vtkRenderWindow * rw);
+ void SetDisplayMode(bool i);
+ void FlipHorizontalView();
+ void FlipVerticalView();
+ void Render();
+ ///Sets the camera to fit the image in the window
+ void ResetCamera();
+
+ void SetVFSubSampling(int sub);
+ int GetVFSubSampling() {
+ return mSubSampling;
+ }
+ void SetVFScale(int scale);
+ void SetVFWidth(int width);
+ int GetVFScale() {
+ return mScale;
+ }
+ void SetVFLog(int log);
+ int GetVFLog() {
+ return mVFLog;
+ }
+
+ void SetFileName(std::string filename) {
+ mFileName = filename;
+ }
+ std::string GetFileName() {
+ return mFileName;
+ }
+
+ double* GetCursorPosition() {
+ return mCursor;
+ }
+
+ void SetCurrentPosition(double x, double y, double z, int t);
+ double* GetCurrentPosition() {
+ return mCurrent;
+ }
+
+ void UpdateCursorPosition();
+ void SetCursorVisibility(bool s);
+ bool GetCursorVisibility();
+ void SetCursorColor(int r,int g, int b);
+
+ void GetExtremasAroundMousePointer(double & min, double & max);
+
+ void UpdateLandmarks();
+ void ForceUpdateDisplayExtent();
+
+ int* GetDisplayExtent();
+ /**Add a polydata to be displayed as a contour over the image
+ ** the contour can be propagated to a time sequence using a motion field */
+ void AddContour(vvMesh::Pointer contours,bool propagate);
+ ///Toggle temporal superposition of contours
+ void ToggleContourSuperposition();
+
+ virtual void SetColorWindow(double s);
+ virtual void SetColorLevel(double s);
- void EnableReducedExtent(bool b);
- void SetReducedExtent(int * ext);
+ void EnableReducedExtent(bool b);
+ void SetReducedExtent(int * ext);
- void ClipDisplayedExtent(int extent[6], int refExtent[6]);
- int GetOrientation();
- int * GetExtent();
+ void ClipDisplayedExtent(int extent[6], int refExtent[6]);
+ int GetOrientation();
+ int * GetExtent();
protected:
- vvSlicer();
- ~vvSlicer();
-
- std::string mFileName;
- vvImage::Pointer mImage;
- vvImage::Pointer mOverlay;
- vvImage::Pointer mFusion;
- vvImage::Pointer mVF;
-
- vvLandmarks* mLandmarks;
-
- vtkSmartPointer<vtkImageMapToWindowLevelColors> mOverlayMapper;
- vtkSmartPointer<vvBlendImageActor> mOverlayActor;
- vtkSmartPointer<vtkImageMapToWindowLevelColors> mFusionMapper;
- vtkSmartPointer<vtkImageActor> mFusionActor;
- vtkSmartPointer<vtkCornerAnnotation> ca;
- vtkSmartPointer<vtkCursor2D> crossCursor;
- vtkSmartPointer<vtkPolyDataMapper2D> pdm;
- vtkSmartPointer<vtkActor2D> pdmA;
- vtkSmartPointer<vvGlyphSource> mArrow;
- vtkSmartPointer<vtkAssignAttribute> mAAFilter;
- vtkSmartPointer<vtkExtractVOI> mVOIFilter;
- vtkSmartPointer<vvGlyph2D> mGlyphFilter;
- vtkSmartPointer<vtkPolyDataMapper> mVFMapper;
- vtkSmartPointer<vtkActor> mVFActor;
- vtkSmartPointer<vtkGlyph3D> mLandGlyph;
- vtkSmartPointer<vtkCursor3D> mCross;
- vtkSmartPointer<vtkClipPolyData> mLandClipper;
- vtkSmartPointer<vtkPolyDataMapper> mLandMapper;
- vtkSmartPointer<vtkActor> mLandActor;
- vtkSmartPointer<vtkBox> mClipBox;
- vtkSmartPointer<vtkScalarBarActor> legend;
- std::vector<vvMeshActor*> mSurfaceCutActors;
-
- int mCurrentTSlice;
- double mCurrent[3];
- double mCursor[4];
- int mSubSampling;
- int mScale;
- int mVFLog;
- int mVFWidth;
- bool mUseReducedExtent;
- int * mReducedExtent;
- int * mInitialExtent;
+ vvSlicer();
+ ~vvSlicer();
+
+ std::string mFileName;
+ vvImage::Pointer mImage;
+ vvImage::Pointer mOverlay;
+ vvImage::Pointer mFusion;
+ vvImage::Pointer mVF;
+
+ vvLandmarks* mLandmarks;
+
+ vtkSmartPointer<vtkImageMapToWindowLevelColors> mOverlayMapper;
+ vtkSmartPointer<vvBlendImageActor> mOverlayActor;
+ vtkSmartPointer<vtkImageMapToWindowLevelColors> mFusionMapper;
+ vtkSmartPointer<vtkImageActor> mFusionActor;
+ vtkSmartPointer<vtkCornerAnnotation> ca;
+ vtkSmartPointer<vtkCursor2D> crossCursor;
+ vtkSmartPointer<vtkPolyDataMapper2D> pdm;
+ vtkSmartPointer<vtkActor2D> pdmA;
+ vtkSmartPointer<vvGlyphSource> mArrow;
+ vtkSmartPointer<vtkAssignAttribute> mAAFilter;
+ vtkSmartPointer<vtkExtractVOI> mVOIFilter;
+ vtkSmartPointer<vvGlyph2D> mGlyphFilter;
+ vtkSmartPointer<vtkPolyDataMapper> mVFMapper;
+ vtkSmartPointer<vtkActor> mVFActor;
+ vtkSmartPointer<vtkGlyph3D> mLandGlyph;
+ vtkSmartPointer<vtkCursor3D> mCross;
+ vtkSmartPointer<vtkClipPolyData> mLandClipper;
+ vtkSmartPointer<vtkPolyDataMapper> mLandMapper;
+ vtkSmartPointer<vtkActor> mLandActor;
+ vtkSmartPointer<vtkBox> mClipBox;
+ vtkSmartPointer<vtkScalarBarActor> legend;
+ std::vector<vvMeshActor*> mSurfaceCutActors;
+
+ int mCurrentTSlice;
+ double mCurrent[3];
+ double mCursor[4];
+ int mSubSampling;
+ int mScale;
+ int mVFLog;
+ int mVFWidth;
+ bool mUseReducedExtent;
+ int * mReducedExtent;
+ int * mInitialExtent;
private:
- void UpdateOrientation();
- void UpdateDisplayExtent();
- void ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int extent[6]);
- void ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
- void ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
- ///Sets the surfaces to be cut on the image slice: update the vtkCutter
- void SetContourSlice();
+ void UpdateOrientation();
+ void UpdateDisplayExtent();
+ void ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int extent[6]);
+ void ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
+ void ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]);
+ ///Sets the surfaces to be cut on the image slice: update the vtkCutter
+ void SetContourSlice();
};
mFileName = filename;
mFileName = vtksys::SystemTools::GetFilenameName(mFileName);
mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
- // DD(mBaseFileName);
mBaseFileNameNumber = number;
for(unsigned int i=0; i<mSlicers.size(); i++) {
SetFilename(filename, n);
// mFileName = vtksys::SystemTools::GetFilenameName(mFileName);
//mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
- // DD(mBaseFileName);
//mBaseFileNameNumber = n;
if (mReader->GetLastError().size() == 0) {
for ( unsigned int i = 0; i < mSlicers.size(); i++) {
mSlicers[i]->SetFileName(vtksys::SystemTools::GetFilenameWithoutLastExtension(filename));
mSlicers[i]->SetImage(mReader->GetOutput());
- // DD(mSlicers[i]->GetFileName());
}
} else {
mLastError = mReader->GetLastError();
return false;
}
// if (n!=0) {
- // // DD(mFileName);
// mFileName.append("_"+clitk::toString(n));
// }
return true;
mReader->Update(type);
mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));
- // DD(mBaseFileName);
mBaseFileNameNumber = n;
if (mReader->GetLastError().size() == 0) {
return false;
}
if (n!=0) {
- // DD(mFileName);
mFileName.append("_"+clitk::toString(n));
- // DD(mFileName);
}
return true;
}
return false;
}
if (vf->GetNumberOfDimensions() == 4) {
- // DD(vf->GetSpacing()[3]);
- // DD(mImage->GetSpacing()[3]);
- // DD(vf->GetOrigin()[3]);
- // DD(mImage->GetOrigin()[3]);
if (vf->GetSpacing()[3] != mImage->GetSpacing()[3]) {
mLastError = "Sorry, vector field time spacing cannot be different from time spacing of the reference image.";
return false;
t++;
if (t > mSlicers[0]->GetTMax())
t = 0;
- // DD("SetNextTSlice");
- // DD(originating_slicer);
- // DD(t);
emit UpdateTSlice(originating_slicer,t);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicerManager::UpdateViews(int current,int slicer)
{
- // DD("UpdateViews");
- // DD(current);
- // DD(slicer);
-
double x = (mSlicers[slicer]->GetCurrentPosition()[0] - mSlicers[slicer]->GetInput()->GetOrigin()[0])
/mSlicers[slicer]->GetInput()->GetSpacing()[0];
double y = (mSlicers[slicer]->GetCurrentPosition()[1] - mSlicers[slicer]->GetInput()->GetOrigin()[1])
mSlicers[i]->SetSlice((int)floor(x));
break;
}
- // DD("UpdateViews::");
- // DD(i);
UpdateSlice(i);
UpdateTSlice(i);
}
//----------------------------------------------------------------------------
void vvSlicerManager::Render()
{
- // DD("vvSlicerManager::Render");
for ( unsigned int i = 0; i < mSlicers.size(); i++) {
- // DD(i);
mSlicers[i]->Render();
}
}
//----------------------------------------------------------------------------
void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index)
{
+ if (actor_type =="overlay") {
+ delete mOverlayReader;
+ mOverlayReader = NULL;
+ }
+
+ if (actor_type =="fusion") {
+ delete mFusionReader;
+ mFusionReader = NULL;
+ }
+
for (unsigned int i = 0; i < mSlicers.size(); i++) {
mSlicers[i]->RemoveActor(actor_type,overlay_index);
}
//----------------------------------------------------------------------------
void vvSlicerManager::RemoveActors()
{
- ///This method leaks a few objects. See RemoveActor for what a correct implementation would look like
+ ///This method leaks a few objects. See RemoveActor for what a
+ ///correct implementation would look like
+ //DS -> probably due to the reader (now released in the
+ //RemoveActor() function. (I hope)
for ( unsigned int i = 0; i < mSlicers.size(); i++) {
mSlicers[i]->SetDisplayMode(0);
mSlicers[i]->GetRenderer()->RemoveActor(mSlicers[i]->GetImageActor());
//----------------------------------------------------------------------------
void vvSlicerManager::UpdateSlice(int slicer)
{
- // DD("vvSlicerManager::UpdateSlice emit UpdateSlice");
- // DD(slicer);
- // DD(mSlicers[slicer]->GetSlice());
if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {
//DD("============= NOTHING");
return;
//----------------------------------------------------------------------------
void vvSlicerManager::UpdateTSlice(int slicer)
{
- // DD("vvSlicerManager::UpdateTSlice emit UpdateTSlice");
- // DD(slicer);
- // DD(mSlicers[slicer]->GetTSlice());
- // DD(mSlicers[slicer]->GetSlice());
if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {
if (mPreviousTSlice[slicer] == mSlicers[slicer]->GetTSlice()) {
// DD("************** NOTHING ***********");
void SetSlicerWindow(int i, vtkRenderWindow* RW);
void SetInteractorStyleNavigator(int i,vtkInteractorStyle* style);
- int NumberOfSlicers() { return mSlicers.size(); }
+ int GetNumberOfSlicers() { return mSlicers.size(); }
vvImage::Pointer GetImage() { return mImage; }
vvImage::Pointer GetVF() { return mVF; }
int GetType() { return mType; }
if (event == vtkCommand::StartPickEvent && VisibleInWindow == -1) {
- for (int i = 0; i < this->SM->NumberOfSlicers(); i++) {
+ for (int i = 0; i < this->SM->GetNumberOfSlicers(); i++) {
if (this->SM->GetSlicer(i)->GetCursorVisibility()) {
this->SM->GetSlicer(i)->SetCursorVisibility(0);
this->SM->GetSlicer(i)->Render();
return;
}
if (KeyPress == "x") {
- for(int i=0; i<SM->NumberOfSlicers(); i++) {
+ for(int i=0; i<SM->GetNumberOfSlicers(); i++) {
SM->RemoveActor("overlay",0);
SM->SetColorMap(0);
SM->Render();
mBGSlider->SetSingleStep(1);
// VTK objects for interactive display
- for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mImageContour.push_back(new vvImageContour);
mImageContour[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
mImageContour[i]->SetColor(1.0, 0.0, 0.0);
//------------------------------------------------------------------------------
// void vvToolBinarize::LeftButtonReleaseEvent(int slicer) {
// DD("LeftButtonReleaseEvent");
-// for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+// for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
// if (i == slicer);
// mCurrentSlicerManager->GetSlicer(i)->GetRenderWindow()->Render();
// }
if (mRadioButtonLowerThan->isChecked()) {
mThresholdSlider1->SetMaximum(v);
if (!mInteractiveDisplayIsEnabled) return;
- for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0;i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mImageContourLower[i]->Update(v);
}
mCurrentSlicerManager->Render();
mThresholdSlider2->SetMinimum(v);
// int m1 = (int)lrint(v);
if (!mInteractiveDisplayIsEnabled) return;
- for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0;i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mImageContour[i]->Update(v);
}
mCurrentSlicerManager->Render();
//------------------------------------------------------------------------------
void vvToolCropImage::UpdateExtent()
{
- for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mCurrentSlicerManager->GetSlicer(i)->SetReducedExtent(mReducedExtent);
mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
mCurrentSlicerManager->GetSlicer(i)->Render();
mInitialExtent = new int[mExtentSize];
mReducedExtent = mCurrentSlicerManager->GetImage()->GetFirstVTKImageData()->GetWholeExtent();
for(int i=0; i<mExtentSize; i++) mInitialExtent[i] = mReducedExtent[i];
- for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mCurrentSlicerManager->GetSlicer(i)->EnableReducedExtent(true);
}
// filter to retrieve the correct image size
for(int i=0; i<mExtentSize; i++) {
mReducedExtent[i] = mInitialExtent[i];
- DD(mArgsInfo.boundingBox_arg[i]);
+ // DD(mArgsInfo.boundingBox_arg[i]);
}
UpdateExtent();
filter->Update();
}
catch(clitk::ExceptionObject & e) {
- DD(e.what());
+ // DD(e.what());
QApplication::restoreOverrideCursor();
close();
}
//------------------------------------------------------------------------------
void vvToolRigidReg::SetOverlay(vvImage::Pointer Image)
{
- for (int i =0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for (int i =0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mCurrentSlicerManager->GetSlicer(i)->SetOverlay(Image);
mCurrentSlicerManager->GetSlicer(i)->SetActorVisibility("overlay",0,true);
mCurrentSlicerManager->SetColorMap();
//------------------------------------------------------------------------------
void vvToolRigidReg::RemoveOverlay()
{
- for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers();i++)
+ for(int i=0;i<mCurrentSlicerManager->GetNumberOfSlicers();i++)
{
mInput1->RemoveActor("overlay",0);
mInput1->SetColorMap(0);
//------------------------------------------------------------------------------
void vvToolRigidReg::Render()
{
- for (int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
mCurrentSlicerManager->GetSlicer(i)->Render();
}
vvToolStructureSetManager::~vvToolStructureSetManager()
{
m_NumberOfTool--;
+ // DD(mStructureSetsList.size());
+ // DD(mStructureSetActorsList.size());
+ for(uint i=0; i<mStructureSetsList.size();i++) {
+ // DD(i);
+ delete mStructureSetsList[i];
+ delete mStructureSetActorsList[i];
+ }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
int vvToolStructureSetManager::AddStructureSet(clitk::DicomRT_StructureSet * mStructureSet) {
// Create actor for this SS
- vvStructureSetActor * mStructureSetActor = new vvStructureSetActor;
+
+ vvStructureSetActor * mStructureSetActor = new vvStructureSetActor;
+
mStructureSetActor->SetStructureSet(mStructureSet);
mStructureSetActor->SetSlicerManager(mCurrentSlicerManager);
// Insert in lists and get index
}
vvImage::Pointer binaryImage = mReader->GetOutput();
AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value());
+ delete mReader;
}
UpdateImage();
}
for(unsigned int i=0; i<mLoadedROIIndex.size(); i++) {
mCurrentStructureSetActor->GetROIActor(mLoadedROIIndex[i])->Update();
}
- for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+ for(int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
mCurrentSlicerManager->GetSlicer(i)->Render();
}
}
//------------------------------------------------------------------------------
-void vvToolStructureSetManager::AddImage(vvImage::Pointer binaryImage, std::string filename, double BG, bool m_modeBG)
+void vvToolStructureSetManager::AddImage(vvImage * binaryImage, std::string filename,
+ double BG, bool m_modeBG)
{
// Check current structure set
int index;
void AddRoiInTreeWidget(clitk::DicomRT_ROI * roi, QTreeWidget * w);
static vvToolStructureSetManager * AddImage(vvSlicerManager * m, std::string name, vvImage::Pointer image, double BG, bool modeBG=true);
- void AddImage(vvImage::Pointer image, std::string filename, double BG, bool modeBG=true);
+ void AddImage(vvImage * image, std::string filename, double BG, bool modeBG=true);
void UpdateImage();
public slots:
bool mIsAllVisibleEnabled;
int mNumberOfVisibleROI;
int mNumberOfVisibleContourROI;
- std::vector<clitk::DicomRT_StructureSet*> mStructureSetsList;
+ std::vector<clitk::DicomRT_StructureSet* > mStructureSetsList;
std::vector<vvStructureSetActor *> mStructureSetActorsList;
std::map<int, QTreeWidgetItem *> mMapStructureSetIndexToTreeWidget;
std::map<clitk::DicomRT_ROI*, QTreeWidgetItem *> mMapROIToTreeWidget;