BoxChangeImageSlice
-180.302777:-317.574649:-900.000000
FIN_COMPLEX_PORT
-COMPLEXINPUTS:9
+COMPLEXINPUTS:11
COMPLEX_PORT
Direction
-431.136158:282.815347:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Interpolation_mode
-43.962217:266.623739:-900.000000
+37.224821:284.244621:-900.000000
FIN_COMPLEX_PORT
-BOXES:43
+COMPLEX_PORT
+TypeTransparence
+-493.056508:283.285820:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+transparenceBeforeAboveRange
+-552.809749:283.731184:-900.000000
+FIN_COMPLEX_PORT
+BOXES:45
BOX
creaMaracasVisu:SliceImage:Box00
ISEXEC:FALSE
vtk:Transform:Box17
ISEXEC:FALSE
-320.706867:-77.874112:-900.000000
--216.883834:-87.874112:-900.000000
+-285.131867:-87.874112:-900.000000
FIN_BOX
BOX
std:ConcatStrings:Box18
creaVtk:ScalarsToColors:Box22
ISEXEC:FALSE
-266.449667:-213.711970:-900.000000
--211.174992:-223.711970:-900.000000
+-224.924667:-223.711970:-900.000000
PORT
-Type:"1"
+Type:"101"
FIN_BOX
BOX
vtk:Transform:Box32
ISEXEC:FALSE
-321.807500:-96.018762:-900.000000
--217.103627:-106.018762:-900.000000
+-286.232500:-106.018762:-900.000000
FIN_BOX
BOX
creaMaracasVisu:DrawAxisTree3D:Box26
ISEXEC:FALSE
-516.159924:-217.577049:-900.000000
--235.323332:-227.577049:-900.000000
+-467.839924:-227.577049:-900.000000
PORT
Colour:"0 0 0"
PORT
vtk:Transform:Box27
ISEXEC:FALSE
-316.662998:-136.217224:-900.000000
--216.004660:-146.217224:-900.000000
+-281.087998:-146.217224:-900.000000
FIN_BOX
BOX
std:CreateArithmeticSuiteVector:Box33
ISEXEC:FALSE
-531.652610:-47.521093:-900.000000
--269.420233:-57.521093:-900.000000
+-477.677610:-57.521093:-900.000000
PORT
Delta:"0"
PORT
std:GetVectorDoubleElement:Box34
ISEXEC:FALSE
-528.461121:-23.430170:-900.000000
--268.760853:-33.430170:-900.000000
+-477.411121:-33.430170:-900.000000
PORT
I:"0"
FIN_BOX
std:MathOperationVector:Box35
ISEXEC:FALSE
-532.115714:-65.685386:-900.000000
--245.000026:-75.685386:-900.000000
+-484.590714:-75.685386:-900.000000
PORT
In1:"0 1 1 0 0 "
PORT
std:CreateArithmeticSuiteVector:Box36
ISEXEC:FALSE
-461.446157:-46.434918:-900.000000
--254.034698:-56.434918:-900.000000
+-407.471157:-56.434918:-900.000000
PORT
Delta:"0"
PORT
std:MathOperationVector:Box37
ISEXEC:FALSE
-462.838158:-67.517853:-900.000000
--229.614491:-77.517853:-900.000000
+-415.313158:-77.517853:-900.000000
PORT
In1:"0 0 1 1 0 "
PORT
std:ConcatStrings:Box40
ISEXEC:FALSE
-451.527135:125.243442:-900.000000
--230.276764:115.243442:-900.000000
+-411.802135:115.243442:-900.000000
PORT
In1:"0"
FIN_BOX
std:StringSelect:Box41
ISEXEC:FALSE
-369.319073:-76.024573:-900.000000
--209.173708:-86.024573:-900.000000
+-327.159073:-86.024573:-900.000000
PORT
In0:"0 1 0 0"
PORT
std:GetVectorDoubleElement:Box44
ISEXEC:FALSE
-459.560548:-23.370210:-900.000000
--253.595111:-33.370210:-900.000000
+-408.510548:-33.370210:-900.000000
PORT
I:"1"
FIN_BOX
vtk:Transform:Box52
ISEXEC:FALSE
-312.196510:-56.034435:-900.000000
--215.125487:-66.034435:-900.000000
+-276.621510:-66.034435:-900.000000
FIN_BOX
BOX
std:StringSelect:Box55
std:ConcatStrings:Box57
ISEXEC:FALSE
-364.668989:127.201835:-900.000000
--211.154742:117.201835:-900.000000
+-324.943989:117.201835:-900.000000
PORT
In2:" "
FIN_BOX
std:ConcatStrings:Box62
ISEXEC:FALSE
-297.110093:125.771424:-900.000000
--196.428586:115.771424:-900.000000
+-257.385093:115.771424:-900.000000
PORT
In1:"1 1 0"
FIN_BOX
std:Add:Box67
ISEXEC:FALSE
-389.417275:153.273064:-900.000000
--241.289576:143.273064:-900.000000
+-358.967275:143.273064:-900.000000
FIN_BOX
BOX
std:GetVectorDoubleElement:Box68
std:Add:Box70
ISEXEC:FALSE
-345.592205:152.557386:-900.000000
--231.618668:142.557386:-900.000000
+-315.142205:142.557386:-900.000000
FIN_BOX
BOX
std:MathOperation:Box72
ISEXEC:FALSE
-257.408453:-30.946538:-900.000000
--209.196852:-40.946538:-900.000000
+-216.358453:-40.946538:-900.000000
PORT
In1:"1"
PORT
std:MathOperation:Box73
ISEXEC:FALSE
-263.661305:-53.857110:-900.000000
--210.515612:-63.857110:-900.000000
+-222.611305:-63.857110:-900.000000
PORT
Type:"2"
FIN_BOX
std:StringSelect:Box74
ISEXEC:FALSE
-336.062237:53.397805:-900.000000
--201.920527:43.397805:-900.000000
+-293.902237:43.397805:-900.000000
PORT
In0:"2"
PORT
std:GetVectorDoubleElement:Box75
ISEXEC:FALSE
-261.893099:1.211259:-900.000000
--210.076025:-8.788741:-900.000000
+-210.843099:-8.788741:-900.000000
FIN_BOX
BOX
vtk:Transform:Box79
ISEXEC:FALSE
-313.408336:-36.360191:-900.000000
--215.345280:-46.360191:-900.000000
+-277.833336:-46.360191:-900.000000
PORT
Scale:"1 1 1"
FIN_BOX
std:StringSelect:Box81
ISEXEC:FALSE
-474.548561:74.412243:-900.000000
--232.252011:64.412243:-900.000000
+-432.388561:64.412243:-900.000000
PORT
In0:"0"
PORT
BOX
std:MagicBox:Box78
ISEXEC:FALSE
-28.546863:157.851551:-900.000000
-64.621863:147.851551:-900.000000
+26.038479:172.632362:-900.000000
+62.113479:162.632362:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box84
+ISEXEC:FALSE
+-501.738590:206.404618:-900.000000
+-465.663590:196.404618:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box85
+ISEXEC:FALSE
+-570.159315:210.007455:-900.000000
+-534.084315:200.007455:-900.000000
FIN_BOX
-CONNECTIONS:67
+CONNECTIONS:71
CONNECTION
Box22:LookupTable:Box04:LookupTable
NumberOfControlPoints:0
Interpolation_mode:Interpolation_mode:Box78:In
NumberOfControlPoints:0
CONNECTION
-Box78:Out:Box00:InterpolationMode
+Box78:Out:Box04:InterpolationMode
+NumberOfControlPoints:0
+CONNECTION
+TypeTransparence:TypeTransparence:Box84:In
+NumberOfControlPoints:0
+CONNECTION
+Box84:Out:Box22:Type
+NumberOfControlPoints:0
+CONNECTION
+Box85:Out:Box22:BelowAboveRangeTransparence
+NumberOfControlPoints:0
+CONNECTION
+transparenceBeforeAboveRange:transparenceBeforeAboveRange:Box85:In
NumberOfControlPoints:0
APP_END
new vtk:ImageVtkProperties Box20
new creaVtk:ScalarsToColors Box22
- set Box22.Type "1"
+ set Box22.Type "101"
new vtk:Transform Box32
new std:MagicBox Box78
+new std:MagicBox Box84
+
+new std:MagicBox Box85
+
connect Box22.LookupTable Box04.LookupTable
connect Box32.Out Box04.Transform
connect Box82.Out Box34.In
connect Box82.Out Box44.In
connect Box83.Out Box26.Active
-connect Box78.Out Box00.InterpolationMode
+connect Box78.Out Box04.InterpolationMode
+connect Box84.Out Box22.Type
+connect Box85.Out Box22.BelowAboveRangeTransparence
# Complex input ports
input Direction Box40.In1 " "
input WindowColorLevel Box65.In1 " "
input BorderActive Box83.In " "
input Interpolation_mode Box78.In " "
+input TypeTransparence Box84.In " "
+input transparenceBeforeAboveRange Box85.In " "
# Complex output ports
output BoxChangeImageSlice Box04.BoxChange " "
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if (bbGetInputwxVtkBaseView()!=NULL)
+ if (bbGetInputActive()==true)
{
- vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxVtkBaseView()->GetVtkBaseData());
- if (bbGetInputPoint().size()==3)
+ if (bbGetInputwxVtkBaseView()!=NULL)
{
- vtkmprbasedata->SetX( bbGetInputPoint()[0] );
- vtkmprbasedata->SetY( bbGetInputPoint()[1] );
- vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
- vtkmprbasedata->SetFixAxis2D( bbGetInputFixAxis2D() );
- wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
-//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
-#if wxMAJOR_VERSION <= 2
- bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
-#else
- bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
-#endif
- } // if bbGetInputPosition
- } // bbGetInputwxVtkBaseView
+ vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxVtkBaseView()->GetVtkBaseData());
+ if (bbGetInputPoint().size()==3)
+ {
+ vtkmprbasedata->SetX( bbGetInputPoint()[0] );
+ vtkmprbasedata->SetY( bbGetInputPoint()[1] );
+ vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
+ vtkmprbasedata->SetFixAxis2D( bbGetInputFixAxis2D() );
+ wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+ #if wxMAJOR_VERSION <= 2
+ bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+ #else
+ bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+ #endif
+ } // if bbGetInputPosition
+ } // bbGetInputwxVtkBaseView
+ } // Active
+
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
- bbSetInputwxVtkBaseView( NULL ) ;
- bbSetInputFixAxis2D( false ) ;
+ bbSetInputActive(true);
+ bbSetInputwxVtkBaseView( NULL ) ;
+ bbSetInputFixAxis2D( false ) ;
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
//=====
+ BBTK_DECLARE_INPUT(Active,bool);
BBTK_DECLARE_INPUT(Point,std::vector<int>);
BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
BBTK_DECLARE_INPUT(FixAxis2D,bool);
BBTK_AUTHOR("Info-Dev");
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(SetPosition,Active,"(default true) true/false",bool,"");
BBTK_INPUT(SetPosition,Point,"vector with point to be set [X Y Z]",std::vector<int>,"");
BBTK_INPUT(SetPosition,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
BBTK_INPUT(SetPosition,FixAxis2D,"(default false) true/false",bool,"");
+
// BBTK_OUTPUT(SetPosition,Out,"First output",double,"");
BBTK_END_DESCRIBE_BLACK_BOX(SetPosition);
//=====
}
imageReslice->SetOutputDimensionality(2);
- if ( bbGetInputInterpolationMode()==0) { printf("EED neighbor\n"); imageReslice->SetInterpolationModeToNearestNeighbor(); }
- if ( bbGetInputInterpolationMode()==1) { printf("EED linear\n"); imageReslice->SetInterpolationModeToLinear(); }
- if ( bbGetInputInterpolationMode()==2) { printf("EED Cubic\n"); imageReslice->SetInterpolationModeToCubic(); }
+ if ( bbGetInputInterpolationMode()==0) { imageReslice->SetInterpolationModeToNearestNeighbor(); }
+ if ( bbGetInputInterpolationMode()==1) { imageReslice->SetInterpolationModeToLinear(); }
+ if ( bbGetInputInterpolationMode()==2) { imageReslice->SetInterpolationModeToCubic(); }
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
bbSetInputIn(NULL);
bbSetInputZ(0);
bbSetInputSlice(0);
- bbSetInputInterpolationMode(2); // Linear
+ bbSetInputInterpolationMode(0); // Linear
bbSetInputTypeOrientation(0);
imageReslice=NULL;
std::vector<double> lstCos;
BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,"");
BBTK_INPUT(SliceImage,Slice,"Slice",double,"");
BBTK_INPUT(SliceImage,Z,"Z (deprecated)",double,"");
- BBTK_INPUT(SliceImage,InterpolationMode,"(default 1) 0=NearestNeighbor 1=Linear 2=Cubic",int,"");
+ BBTK_INPUT(SliceImage,InterpolationMode,"(default 0) 0=NearestNeighbor 1=Linear 2=Cubic",int,"");
BBTK_INPUT(SliceImage,ResliceAxesDirectionCosines,"ResliceAxesDirectionCosines [v1x,v1y,v1z,v2x,v2y,v2z,v3x,v3y,v3z], ",std::vector<double>,"");
BBTK_INPUT(SliceImage,TypeOrientation,"Type orientation (default 0) 0=XY, 1=X-Z, -1=XZ, 2=Y-Z, -2=ZY, 3=Free (Set the input ResliceAxesDirectionCosines)",int,"");
void ImageActor::Process()
{
//JCP 04/04/09
- vtkRenderer *render = bbGetInputRenderer();
vtkImageData *img = bbGetInputIn();
vtkLinearTransform* transform = bbGetInputTransform();
imageactor->SetInputData( img );
#endif
} else {
-/*
- vtkLookupTable *table = vtkLookupTable::New();
- table->SetRange(0, 1000); // image intensity range
- table->SetValueRange(0.0, 1.0); // from black to white
- table->SetSaturationRange(0.0, 0.0); // no color saturation
- table->SetRampToLinear();
- table->Build();
- double rgba[4];
- table->GetTableValue(0,rgba);
- rgba[3]=0;
- table->SetTableValue(0,rgba);
-*/
-
-
-/*
- vtkLookupTable *table = vtkLookupTable::New();
- table->SetTableRange (0, 2000);
- table->SetHueRange (1, 0);
- table->SetSaturationRange (1, 1);
- table->SetValueRange (1, 1);
- table->Build(); //effective built
-*/
-
-/*
-vtkColorTransferFunction *table = vtkColorTransferFunction::New();
-table->SetColorSpaceToHSV();
- table->HSVWrapOff();
- table->AddHSVSegment(0.0, 0.6, 1.0, 1.0,
- 1.0, 0.0, 1.0, 1.0);
- table->SetNanColor(1.0, 0.0, 1.0);
-*/
-
-/*
-printf("EED ImageActor::Process Warnning ***************************Not here this code *");
-vtkLookupTable *table = vtkLookupTable::New();
- table->SetNumberOfTableValues(1000);
- table->SetRange(0, 1000);
- table->Build();
- double rgba1[4];
- double rgba2[4];
- for (int iLookTable = 0; iLookTable<500; iLookTable++)
- {
- table->GetTableValue( iLookTable, rgba1);
- table->GetTableValue(1000-1-iLookTable, rgba2);
- table->SetTableValue(1000-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
- table->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
- } // for iLookTable
- double rgba[4];
- table->GetTableValue(0,rgba);
- rgba[3]=0;
- table->SetTableValue(0,rgba);
-*/
vtkImageMapToColors *color = vtkImageMapToColors::New();
color->SetLookupTable( bbGetInputLookupTable() );
-// color->SetLookupTable( table );
color->PassAlphaToOutputOn();
-// imageshiftscale->SetInput( img );
-// imageshiftscale->SetOutputScalarTypeToUnsignedChar();
-
-// color->SetInput( imageshiftscale->GetOutput() );
-
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
color->SetInput( img );
color->Update();
imageactor->GetMapper()->SetInputData( color->GetOutput() );
#endif
- imageactor->GetProperty()->SetInterpolationTypeToNearest();
+
+ if ( bbGetInputInterpolationMode()==0) { imageactor->GetProperty()->SetInterpolationTypeToNearest(); }
+ if ( bbGetInputInterpolationMode()==1) { imageactor->GetProperty()->SetInterpolationTypeToLinear(); }
+ if ( bbGetInputInterpolationMode()==2) { imageactor->GetProperty()->SetInterpolationTypeToCubic(); }
imageactor->SetForceOpaque(true);
}
{
imageactor->SetUserTransform( transform );
} // transform
- if(render != NULL )
- {
-// render->AddActor( imageactor );
- } // render
bbSetOutputOut(imageactor);
} // img
firsttime = true;
imageactor = NULL;
bbSetInputIn(NULL);
-// bbSetInputType(0);
bbSetInputOpacity(1);
bbSetInputTransform(NULL);
bbSetInputRenderer(NULL);
bbSetInputLookupTable(NULL);
+ bbSetInputInterpolationMode(0);
}
BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
BBTK_DECLARE_INPUT(Opacity,double);
BBTK_DECLARE_INPUT(LookupTable,vtkScalarsToColors*);
-// BBTK_DECLARE_INPUT(Type,int);
+ BBTK_DECLARE_INPUT(InterpolationMode,int);
+
BBTK_DECLARE_OUTPUT(Out,vtkProp3D*);
BBTK_PROCESS(Process);
void Process();
BBTK_DESCRIPTION("put image in a 3D univers");
BBTK_CATEGORY("");
BBTK_INPUT(ImageActor,In,"Image input",vtkImageData*,"");
-// BBTK_INPUT(ImageActor,Type,"0 (default) vtkImageShiftScale Unsigned Char, 1 ColorTable",int,"");
BBTK_INPUT(ImageActor,Transform,"Transform",vtkLinearTransform*,"");
BBTK_INPUT(ImageActor,Renderer,"Renderer",vtkRenderer*,"");
BBTK_INPUT(ImageActor,Opacity,"Opacity [0-1]",double,"");
+ BBTK_INPUT(ImageActor,InterpolationMode,"(default 0) 0=NearestNeighbor 1=Linear 2=Cubic",int,"");
BBTK_INPUT(ImageActor,LookupTable,"LookupTable [vtkScalarsToColors]",vtkScalarsToColors*,"");
BBTK_OUTPUT(ImageActor,Out,"Output vtk actor",vtkProp3D*,"");
BBTK_END_DESCRIBE_BLACK_BOX(ImageActor);