Commit bdc1202d authored by freudling's avatar freudling
Browse files

ENH: Sliders now in "Box Coordinate system". Green handle->yellow handle

git-svn-id: http://svn.slicer.org/Slicer4/trunk@5682 3bd1e089-480b-0410-8dfb-8563597acbee
parent 5b72407e
......@@ -1193,7 +1193,7 @@ void vtkSlicerBoxWidget::CreateDefaultProperties()
this->HandleProperties[0]->SetColor(1,0,1);
this->HandleProperties[1]->SetColor(1,0,0);
this->HandleProperties[2]->SetColor(1,1,1);
this->HandleProperties[3]->SetColor(0,1,0);
this->HandleProperties[3]->SetColor(.89,.6,.07);
this->HandleProperties[4]->SetColor(0,0,1);
this->HandleProperties[5]->SetColor(0,0,0);
this->HandleProperties[6]->SetColor(1,1,1);
......
......@@ -132,9 +132,9 @@ vtkSlicerVRGrayscaleHelper::vtkSlicerVRGrayscaleHelper(void)
ColorsClippingHandles[2][1]=1;
ColorsClippingHandles[2][2]=1;
ColorsClippingHandles[3][0]=0;
ColorsClippingHandles[3][1]=1;
ColorsClippingHandles[3][2]=0;
ColorsClippingHandles[3][0]=.89;
ColorsClippingHandles[3][1]=.6;
ColorsClippingHandles[3][2]=.07;
ColorsClippingHandles[4][0]=0;
ColorsClippingHandles[4][1]=0;
......@@ -599,6 +599,10 @@ void vtkSlicerVRGrayscaleHelper::ProcessVolumeRenderingEvents(vtkObject *caller,
//Include a possible transform in this calculation
this->InverseAdditionalClippingTransform->TransformPoint(pointA,pointA);
this->InverseAdditionalClippingTransform->TransformPoint(pointB,pointB);
//Convert this stuff into the box coordinate system
this->ConvertWorldToBoxCoordinates(pointA);
this->ConvertWorldToBoxCoordinates(pointB);
vtkImageData *iData=vtkMRMLScalarVolumeNode::SafeDownCast(this->Gui->GetNS_ImageData()->GetSelected())->GetImageData();
for(int i=0; i<3;i++)
......@@ -1273,13 +1277,16 @@ void vtkSlicerVRGrayscaleHelper::Cropping(int index, double min,double max)
{
return;
}
this->BW_Clipping->PlaceWidget(
this->RA_Cropping[0]->GetRange()[0],
this->RA_Cropping[0]->GetRange()[1],
this->RA_Cropping[1]->GetRange()[0],
this->RA_Cropping[1]->GetRange()[1],
this->RA_Cropping[2]->GetRange()[0],
this->RA_Cropping[2]->GetRange()[1]);
double pointA[3];
double pointB[3];
for(int i=0;i<3;i++)
{
pointA[i]=this->RA_Cropping[i]->GetRange()[0];
pointB[i]=this->RA_Cropping[i]->GetRange()[1];
}
this->ConvertBoxCoordinatesToWorld(pointA);
this->ConvertBoxCoordinatesToWorld(pointB);
this->BW_Clipping->PlaceWidget(pointA[0],pointB[0],pointA[1],pointB[1],pointA[2],pointB[2]);
this->BW_Clipping->SetTransform(this->AdditionalClippingTransform);
this->NoSetRangeNeeded=1;
this->ProcessVolumeRenderingEvents(this->BW_Clipping,vtkCommand::InteractionEvent,0);
......@@ -2059,7 +2066,38 @@ void vtkSlicerVRGrayscaleHelper::CalculateAndSetSampleDistances(void)
void vtkSlicerVRGrayscaleHelper::ConvertWorldToBoxCoordinates(double *inputOutput)
{
int pointAint[3];
double pointA[4];
vtkMRMLScalarVolumeNode::SafeDownCast(this->Gui->GetNS_ImageData()->GetSelected())->GetImageData()->GetDimensions(pointAint);
for(int i=0;i<3;i++)
{
pointA[i]=pointAint[i]/2.;
}
pointA[3]=1;
vtkMatrix4x4 *matrix=vtkMatrix4x4::New();
this->CalculateMatrix(matrix);
matrix->MultiplyPoint(pointA,pointA);
for(int i=0;i<3;i++)
{
inputOutput[i]=inputOutput[i]-pointA[i];
}
}
void vtkSlicerVRGrayscaleHelper::ConvertBoxCoordinatesToWorld(double* inputOutput)
{
int pointAint[3];
double pointA[4];
vtkMRMLScalarVolumeNode::SafeDownCast(this->Gui->GetNS_ImageData()->GetSelected())->GetImageData()->GetDimensions(pointAint);
for(int i=0;i<3;i++)
{
pointA[i]=pointAint[i]/2.;
}
pointA[3]=1;
vtkMatrix4x4 *matrix=vtkMatrix4x4::New();
this->CalculateMatrix(matrix);
matrix->MultiplyPoint(pointA,pointA);
for(int i=0;i<3;i++)
{
inputOutput[i]=inputOutput[i]+pointA[i];
}
}
......@@ -173,7 +173,7 @@ void vtkVolumeRenderingModuleGUI::BuildGUI(void)
this->GetUIPanel()->AddPage("VolumeRendering","VolumeRendering",NULL);
// Define your help text and build the help frame here.
const char *help = "VolumeRendering. 3D Segmentation This module is currently a prototype and will be under active development throughout 3DSlicer's Beta release.";
const char *help = "Volume Rendering allows the rendering of volumes in 3D space and not only as 2D surfaces defined in 3D space. Tutorials are available at http://www.na-mic.org/Wiki/index.php/Slicer3:Volume_Rendering_Tutorials";
const char *about = "This work is supported by NA-MIC, NAC, BIRN, NCIGT, and the Slicer Community. See http://www.slicer.org for details.";
vtkKWWidget *page = this->UIPanel->GetPageWidget ( "VolumeRendering" );
this->BuildHelpAndAboutFrame ( page, help, about );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment