]> Creatis software - bbtk.git/commitdiff
#3550 std VectorFilterDouble type 18 , min max postion vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 6 Nov 2026 14:23:02 +0000 (15:23 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 6 Nov 2026 14:23:02 +0000 (15:23 +0100)
packages/std/src/bbstdVectorFilterDouble.cxx
packages/std/src/bbstdVectorFilterDouble.h
packages/wxvtk/src/wxvtkImageViewer2.cxx

index 1c84de1..0f71e15 100644 (file)
@@ -574,6 +574,33 @@ void VectorFilterDouble::Process()
     } // if Type 17
     
 
+    if (bbGetInputType()==18)   // 18  [Min MinPosition Max MaxPosition
+    {
+        int i,size=In0.size();
+        if (size>=1) {
+            double min=In0[0];
+            double max=In0[0];
+            int iMin=0;
+            int iMax=0;
+            for (i=1;i<size;i++)
+            {
+                if ( In0[i]<min )
+                {
+                    min     = In0[i];
+                    iMin    = i;
+                } // if min
+                if ( In0[i]>max )
+                {
+                    max     = In0[i];
+                    iMax    = i;
+                } // if max
+            } // for i
+            Out0.push_back( min );
+            Out0.push_back( iMin );
+            Out0.push_back( max );
+            Out0.push_back( iMax );
+        } //size >=1
+    } // if Type 18
     
        bbSetOutputOut0( Out0 );
        bbSetOutputOut1( Out1 );
index 25bd785..4702711 100644 (file)
@@ -52,7 +52,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorFilterDouble,bbtk::AtomicBlackBox);
   BBTK_AUTHOR("InfoDev");
   BBTK_DESCRIPTION("No Description.");
   BBTK_CATEGORY("empty");
-  BBTK_INPUT(VectorFilterDouble,Type,"default (0) -1=Erase line if In0==k1,  0=Erase consecutive duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 (or the index k1 if exist) , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ  (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1,  14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) , 15 swhitch element in a point k1=0 xyz->xzy, k1=1 nothing xyz->xyz, k1=2 xyz->yzx , 16 switch In0 and In1 (k1=0 nothing, k1=1 swhich), 17 new order of out vectors k1[newIndex, newIndex, newIndex]",int,"");
+  BBTK_INPUT(VectorFilterDouble,Type,"default (0) -1=Erase line if In0==k1,  0=Erase consecutive duplicated lines, 1=Redimention Vectors, 2=Insert intermediat points,3=Adition k1, 4=Substraction k1, 5=Multilication k1, 6=Division k1, 7=Connect mesh X1,Y1,Z1,idxs1,X2,X2,X2,idx2, 8=Order All vectors with the logic of In0 (or the index k1 if exist) , 9=Invert Vectors, 10=Nearest Point in the vector. In3PointXYZ In0LstX In1LstY In2LstZ  (Out0-index Out1-PointXYZ), 11=Mul Spacing (K1[spcX,spcY,spcZ]=Spacing), 12=Div Spacing (K1[spcX,spcY,spcZ]=Spacing), 13=Distance pointIn0 and pontIn1,  14=Select specific segments [k1] in In0=lstPx In1=lstPy In2=lstPz In3=lstIndex (if k1 empty all segments are selected) , 15 swhitch element in a point k1=0 xyz->xzy, k1=1 nothing xyz->xyz, k1=2 xyz->yzx , 16 switch In0 and In1 (k1=0 nothing, k1=1 swhich), 17 new order of out vectors k1[newIndex, newIndex, newIndex],  18 [min iMax max iMax] of In0",int,"");
   BBTK_INPUT(VectorFilterDouble,k1,"(default [0])  nothing (Type0), k1[0]=new size vectors (Type 1) , nothing (Type2), k1[0] = Addition const. (Type 3), k1[0] = Substraction const. (Type 4), k1[0] = Multiplication const. (Type 5) , k1[0] = Division const. (Type 6),  k1[0] In0..9 element base to be order (Type 8)  , k1[spcX,spcY,spcZ] MulSpc In0_X,In1_Y,In2_Z (type 11),  k1[spcX,spcY,spcZ] DivSpc In0_X,In1_Y,In2_Z (type 12) , k1[segment1, segment2,..] (type 14) , direction (type 15), direction (type 16), new index order for the output (type 17)",std::vector<double>,"");
   BBTK_INPUT(VectorFilterDouble,In0,"Input vector",std::vector<double>,"");
   BBTK_INPUT(VectorFilterDouble,In1,"Input vector",std::vector<double>,"");
index 0e96065..49b2c0c 100644 (file)
@@ -672,32 +672,29 @@ void wxvtkImageViewer2::InstallPipeline()
     }
 
   if (this->Interactor)
-    {
+  {
     if (!this->InteractorStyle)
-      {
+    {
       this->InteractorStyle = vtkInteractorStyleImage::New();
       wxvtkImageViewer2Callback *cbk = wxvtkImageViewer2Callback::New();
       cbk->IV = this;
-      this->InteractorStyle->AddObserver(
-        vtkCommand::WindowLevelEvent, cbk);
-      this->InteractorStyle->AddObserver(
-        vtkCommand::StartWindowLevelEvent, cbk);
-      this->InteractorStyle->AddObserver(
-        vtkCommand::ResetWindowLevelEvent, cbk);
+      this->InteractorStyle->AddObserver( vtkCommand::WindowLevelEvent, cbk         );
+      this->InteractorStyle->AddObserver( vtkCommand::StartWindowLevelEvent, cbk    );
+      this->InteractorStyle->AddObserver( vtkCommand::ResetWindowLevelEvent, cbk    );
       cbk->Delete();
-      }
+    }
 
     this->Interactor->SetInteractorStyle(this->InteractorStyle);
     this->Interactor->SetRenderWindow(this->RenderWindow);
     }
 
   if (this->Renderer && this->ImageActor)
-    {
-    this->Renderer->AddViewProp(this->ImageActor);
-    }
+  {
+      this->Renderer->AddViewProp(this->ImageActor);
+  }
 
   if (this->ImageActor && this->WindowLevel)
-    {
+  {
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
     this->ImageActor->SetInput(this->WindowLevel->GetOutput());