//------------------------------------------------------------------------------
void vvImageContour::Update(double value) {
- std::cout << "vvImageContour::Update " << value << std::endl;
if (!mSlicer) return;
if (mPreviousValue == value) {
if (mPreviousSlice == mSlicer->GetSlice()) {
if (mPreviousTSlice == mSlicer->GetTSlice()) {
if (mPreviousOrientation == ComputeCurrentOrientation()) {
- std::cout << "Nothing to do" << std::endl;
return; // Nothing to do
}
}
UpdateWithFastCacheMode();
}
- // mSlicer->Render(); //DS ---> REMOVE ??
+ //mSlicer->Render(); //DS ---> REMOVE ??
mPreviousTSlice = mSlicer->GetTSlice();
mPreviousSlice = mSlicer->GetSlice();
//------------------------------------------------------------------------------
void vvImageContour::UpdateWithPreserveMemoryMode() {
// Only change actor visibility if tslice change
- int mPreviousTslice = mTSlice;
+ mPreviousTslice = mTSlice;
mTSlice = mSlicer->GetTSlice();
vtkMarchingSquares * mSquares = mSquaresList[mTSlice];
int orientation = ComputeCurrentOrientation();
UpdateActor(mSquaresActor, mapper, mSquares, mClipper, mValue, orientation, mSlice);
- //mSquaresActorList[mTSlice]->VisibilityOn();
if (mPreviousTslice != mTSlice) {
if (mPreviousTslice != -1) mSquaresActorList[mPreviousTslice]->VisibilityOff();
}
+
+ mSlicer->Render();
}
//------------------------------------------------------------------------------
vtkMarchingSquares * squares,
vtkImageClip * clipper,
double threshold, int orientation, int slice) {
- std::cout << "vvImageContour::UpdateActor" << std::endl;
// Set parameter for the MarchigSquare
squares->SetValue(0, threshold);
} else {
extent2 = extent;
+ actor->VisibilityOn();
}
clipper->SetOutputWholeExtent(extent2[0],extent2[1],extent2[2],
extent2[3],extent2[4],extent2[5]);
+ //std::cout << mTSlice << " " << mSlice << " " << extent2[0] << " " << extent2[1] << " " << extent2[2] << " " << extent2[3] << " " << extent2[4] << " " << extent2[5] << std::endl;
+
if (mHiddenImageIsUsed) delete extent2;
// Move the actor to be visible
// }
mapper->Update();
- actor->VisibilityOn();
+
+
+
}
//------------------------------------------------------------------------------
private:
vvImageContour();
~vvImageContour();
+ int mPreviousTslice;
}; // end class vvImageContour
//------------------------------------------------------------------------------
}
//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)
+{
+ mSlicers[slicer]->SetSliceOrientation(orientation);
+ emit UpdateOrientation(slicer, orientation);
+}
+//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void vvSlicerManager::SetTSlice(int slice)
t++;
if (t > mSlicers[0]->GetTMax())
t = 0;
+ //std::cout << "vvSlicerManager::SetNextTSlice" << std::endl;
emit UpdateTSlice(originating_slicer,t);
}
//----------------------------------------------------------------------------
t--;
if (t < 0)
t = mSlicers[0]->GetTMax();
+ //std::cout << "vvSlicerManager::SetPreviousTSlice" << std::endl;
emit UpdateTSlice(originating_slicer,t);
}
//----------------------------------------------------------------------------
//DD("============= NOTHING");
return;
}
+ //std::cout << "vvSlicerManager::UpdateSlice " << slicer << " " << mSlicers[slicer]->GetSlice() << std::endl;
emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());
mSlicers[slicer]->Render(); // DS <-- I add this, this could/must be the only Render ...
mPreviousSlice[slicer] = mSlicers[slicer]->GetSlice();
//----------------------------------------------------------------------------
void vvSlicerManager::UpdateTSlice(int slicer)
{
- std::cout << "vvSlicerManager::UpdateTSlice" << std::endl;
- if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {
- if (mPreviousTSlice[slicer] == mSlicers[slicer]->GetTSlice()) {
+ int slice = mSlicers[slicer]->GetSlice();
+ int tslice = mSlicers[slicer]->GetTSlice();
+ if (mPreviousSlice[slicer] == slice) {
+ if (mPreviousTSlice[slicer] == tslice) {
// DD("************** NOTHING ***********");
return;
}
}
- mPreviousSlice[slicer] = mSlicers[slicer]->GetSlice();
- mPreviousTSlice[slicer] = mSlicers[slicer]->GetTSlice();
- emit UpdateTSlice(slicer,mSlicers[slicer]->GetTSlice());
+ mPreviousSlice[slicer] = slice;
+ mPreviousTSlice[slicer] = tslice;
+ //std::cout << "vvSlicerManager::UpdateTSlice " << slicer << " " << tslice << std::endl;
+ emit UpdateTSlice(slicer, tslice);
}
//----------------------------------------------------------------------------
void SetFilename(std::string f, int number=0);
+ void SetSliceOrientation(int slicer, int orientation);
void SetTSlice(int slice);
void SetNextTSlice(int originating_slicer);
void SetPreviousTSlice(int originating_slicer);
void UpdateOverlay(int display, double valueOver, double valueRef);
void UpdateFusion(int display, double valueFus);
void UpdateWindows(int slicer, int view, int slice);
+ void UpdateOrientation(int slicer, int orientation);
void UpdateSlice(int slicer, int slice);
void UpdateTSlice(int slicer, int slice);
void UpdateSliceRange(int slice, int min, int max, int tmin, int tmax);
if (KeyPress == "F2") {
this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Sagital\n<slice>");
- this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(0);
+ //this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(0);
+ this->SM->SetSliceOrientation(VisibleInWindow, 0);
this->SM->UpdateSliceRange(VisibleInWindow);
}
if (KeyPress == "F3") {
this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Coronal\n<slice>");
- this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(1);
+ //this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(1);
+ this->SM->SetSliceOrientation(VisibleInWindow, 1);
this->SM->UpdateSliceRange(VisibleInWindow);
}
if (KeyPress == "F4") {
this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Axial\n<slice>");
- this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(2);
+ //this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(2);
+ this->SM->SetSliceOrientation(VisibleInWindow, 2);
this->SM->UpdateSliceRange(VisibleInWindow);
}
connect(mCurrentSlicerManager,SIGNAL(UpdateSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
connect(mCurrentSlicerManager,SIGNAL(UpdateTSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
+
+ connect(mCurrentSlicerManager,SIGNAL(UpdateOrientation(int,int)),this,SLOT(UpdateOrientation(int, int)));
// connect(mCurrentSlicerManager, SIGNAL(LeftButtonReleaseSignal(int)), SLOT(LeftButtonReleaseEvent(int)));
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvToolBinarize::UpdateOrientation(int slicer,int orientation)
+{
+ Update(slicer);
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvToolBinarize::UpdateSlice(int slicer,int slices)
{
- std::cout << "vvToolBinarize::UpdateSlice" << std::endl;
+ Update(slicer);
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+void vvToolBinarize::Update(int slicer)
+{
if (!mInteractiveDisplayIsEnabled) return;
if (!mCurrentSlicerManager) close();
mImageContour[slicer]->Update(mThresholdSlider1->GetValue());
}
//------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------
void vvToolBinarize::GetArgsInfoFromGUI()
{
virtual void reject();
void valueChangedT1(double v);
void valueChangedT2(double v);
+ void UpdateOrientation(int slicer, int orientation);
void UpdateSlice(int slicer,int slices);
void enableLowerThan(bool b);
void useFGBGtoggled(bool);
std::vector<vvImageContour::Pointer> mImageContour;
std::vector<vvImageContour::Pointer> mImageContourLower;
bool mInteractiveDisplayIsEnabled;
+
+ void Update(int slicer);
}; // end class vvToolBinarize
//------------------------------------------------------------------------------