vtkImageData *imagedata=NULL;
//std::cout<<"MSJ: test SliceImage::Process()"<<this<<std::endl;
- if ( bbGetInputIn()!=NULL ){
-
+ if ( bbGetInputIn()!=NULL )
+ {
imageReslice->SetInput( bbGetInputIn() );
imageReslice->SetInformationInput(bbGetInputIn() );
- imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
+
+ if (bbGetInputTypeOrientation()==2)
+ {
+ imageReslice->SetResliceAxesDirectionCosines(0,0,1, 1,0,0 ,0,1,0); // 2=YZ
+ } else if (bbGetInputTypeOrientation()==1) {
+ imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,-1 ,0,1,0); // 1=XZ
+ } else
+ {
+ imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1); // 0=XY
+ }
+
+
+
imageReslice->SetResliceAxesOrigin(0,0, bbGetInputZ()*bbGetInputIn()->GetSpacing()[2] );
imageReslice->SetOutputDimensionality(2);
imageReslice->SetInterpolationModeToLinear();
- imagedata = imageReslice->GetOutput();
+ imagedata = imageReslice->GetOutput();
imagedata->Update();
imagedata->UpdateInformation();
//printf("EED 1 SliceImage::Process %p\n", imagedata);
- }
+ }
bbSetOutputOut( imagedata );
}
{
bbSetInputIn(NULL);
bbSetInputZ(0);
+ bbSetInputTypeOrientation(0);
imageReslice=NULL;
}
BBTK_BLACK_BOX_INTERFACE(SliceImage,bbtk::AtomicBlackBox);
BBTK_DECLARE_INPUT(In,vtkImageData*);
BBTK_DECLARE_INPUT(Z, double );
+ BBTK_DECLARE_INPUT(TypeOrientation, int );
BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
BBTK_PROCESS(Process);
void Process();
BBTK_CATEGORY("");
BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,"");
BBTK_INPUT(SliceImage,Z,"Z",double,"");
+BBTK_INPUT(SliceImage,TypeOrientation,"Type orientation (default 0) 0=XY 1=XZ 2=YZ",int,"");
BBTK_OUTPUT(SliceImage,Out,"Output image",vtkImageData *,"");
BBTK_END_DESCRIBE_BLACK_BOX(SliceImage);
}