double range[2];
- double max;
+ double delta;
- if(_vtkmprbasedata->GetImageData()){
+ if(_vtkmprbasedata->GetImageData())
+ {
_vtkmprbasedata->GetImageData()->GetScalarRange(range);
- max = range[1];
+ delta = range[1]-range[0];
_ctFunVectorPoint.clear();
- _ctFunVectorPoint.push_back(max*0/4);
- _ctFunVectorPoint.push_back(max*1/4);
- _ctFunVectorPoint.push_back(max*2/4);
- _ctFunVectorPoint.push_back(max*3/4);
- _ctFunVectorPoint.push_back(max*4/4);
+ _ctFunVectorPoint.push_back( range[0] + delta*0/4 );
+ _ctFunVectorPoint.push_back( range[0] + delta*1/4 );
+ _ctFunVectorPoint.push_back( range[0] + delta*2/4 );
+ _ctFunVectorPoint.push_back( range[0] + delta*3/4 );
+ _ctFunVectorPoint.push_back( range[0] + delta*4/4 );
_ctFunVectorRed.clear();
_ctFunVectorRed.push_back(0.0);
_ctFunVectorBlue.push_back(0.0);
- if(_ctfun==NULL){
+ if(_ctfun==NULL)
+ {
_ctfun = vtkColorTransferFunction::New();
}
_ctfun->RemoveAllPoints();
void vtkMPR3DDataViewer::SetPositionX(int pos){
int x1,x2,y1,y2,z1,z2;
_vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
- if(_saggital){
+ if(_saggital)
+ {
_saggital->SetDisplayExtent( pos , pos , y1 ,y2 , z1 , z2 );
}
}
void vtkMPR3DDataViewer::SetPositionY(int pos){
int x1,x2,y1,y2,z1,z2;
_vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
- if(_coronal){
+ if(_coronal)
+ {
_coronal->SetDisplayExtent(x1,x2, pos,pos, z1,z2);
}
}
void vtkMPR3DDataViewer::SetPositionZ(int pos){
int x1,x2,y1,y2,z1,z2;
_vtkmprbasedata->GetDimensionExtention(&x1,&x2,&y1,&y2,&z1,&z2);
- if(_axial){
+ if(_axial)
+ {
_axial->SetDisplayExtent(x1,x2, y1,y2, pos,pos);
}
}
}
void vtkMPR3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
- if(_saggitalColors){
+ if(_saggitalColors)
+ {
_saggitalColors->SetLookupTable(colortable);
_coronalColors->SetLookupTable(colortable);
_axialColors->SetLookupTable(colortable);