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;
}