]> Creatis software - clitk.git/commitdiff
- change FG/BG to 0-255 value
authordsarrut <dsarrut>
Wed, 12 May 2010 06:20:14 +0000 (06:20 +0000)
committerdsarrut <dsarrut>
Wed, 12 May 2010 06:20:14 +0000 (06:20 +0000)
vv/vvToolBinarize.cxx

index ae067180a5dcf85c2a5cacca54d23e821c1683bb..6d851547b412de98d14dad544966ac401e6cb79a 100644 (file)
@@ -175,10 +175,17 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m) {
   mFGSlider->SetImage(mCurrentImage);
   mBGSlider->SetImage(mCurrentImage);
   //  DD(mCurrentSlicerManager->GetFileName().c_str());
-  mFGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
-  mFGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
-  mBGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
-  mBGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+ //  mFGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+//   mFGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+//   mBGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+//   mBGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+
+  // Output is uchar ...
+  mFGSlider->SetMaximum(255);
+  mFGSlider->SetMinimum(0);
+  mBGSlider->SetMaximum(255);
+  mBGSlider->SetMinimum(0);
+
   mFGSlider->SetValue(1);
   mBGSlider->SetValue(0);
   mFGSlider->SetSingleStep(1);
@@ -221,14 +228,10 @@ void vvToolBinarize::InputIsSelected(vvSlicerManager * m) {
 void vvToolBinarize::UpdateSlice(int slicer,int slices) {
   if (!mInteractiveDisplayIsEnabled) return;
   if (!mCurrentSlicerManager) close();
-  for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
-    //    DD(i);
-    mImageContour[i]->update(mThresholdSlider1->GetValue());
-    if (mRadioButtonLowerThan->isChecked()) 
-      mImageContourLower[i]->update(mThresholdSlider2->GetValue());
-
-  }
-  mCurrentSlicerManager->Render(); 
+  mImageContour[slicer]->update(mThresholdSlider1->GetValue());
+  if (mRadioButtonLowerThan->isChecked()) 
+    mImageContourLower[slicer]->update(mThresholdSlider2->GetValue());
+  //  mCurrentSlicerManager->GetSlicer(slicer)->Render(); 
 }
 //------------------------------------------------------------------------------