Hi,I am trying to implement the 4 planes view thing (axial, coronal,sagittal and 3D(volume render)) using three vtkImagePlaneWidget in the 3D view. but when i modify the 3D volume property (color,Opacity and Contrast),the vtkImagePlaneWidget slices(axial, coronal,sagittal) unable to update synchronously color,Opacity and Contrast.
vtk-9.3.0
I will really appreciate if you can guide me through.
Best Regards
int dimensions[3] = { 0,0,0 };
reader->GetOutput()->GetDimensions(dimensions);
picker->SetTolerance(0.005);
imgPlaneX->SetInputConnection(reader->GetOutputPort());
imgPlaneX->SetPicker(picker);
imgPlaneX->RestrictPlaneToVolumeOn();
imgPlaneX->GetMarginProperty()->SetOpacity(0.0);
imgPlaneX->SetMarginSizeX(0);
imgPlaneX->SetMarginSizeY(0);
imgPlaneX->DisplayTextOn();
imgPlaneX->SetResliceInterpolateToLinear();
imgPlaneX->SetPlaneOrientationToXAxes();
//imgPlaneX->SetWindowLevel(imgBitDepthLevelScale, imgBitDepthLevelScale / 2.0, 0);
imgPlaneX->SetSliceIndex(dimensions[0] / 2);
imgPlaneX->GetTexturePlaneProperty()->SetOpacity(1);
//imgPlaneX->GetCursorProperty()->SetColor(1, 0, 0);
//imgPlaneX->GetMarginProperty()->SetColor(1, 0, 0);
imgPlaneX->GetPlaneProperty()->SetColor(1, 0.25, 0.0);
imgPlaneX->GetSelectedPlaneProperty()->SetColor(0, 1, 0);
//imgPlaneX->GetPlaneProperty()->SetOpacity(1.0);
imgPlaneX->GetPlaneProperty()->SetLineWidth(1);
imgPlaneY->SetInputConnection(reader->GetOutputPort());
imgPlaneY->SetPicker(picker);
imgPlaneY->RestrictPlaneToVolumeOn();
imgPlaneY->GetMarginProperty()->SetOpacity(0);
imgPlaneY->SetMarginSizeX(0);
imgPlaneY->SetMarginSizeY(0);
imgPlaneY->DisplayTextOn();
imgPlaneY->SetResliceInterpolateToLinear();
imgPlaneY->SetPlaneOrientationToYAxes();
//imgPlaneY->SetWindowLevel(imgBitDepthLevelScale, imgBitDepthLevelScale / 2.0, 0);
imgPlaneY->SetSliceIndex(dimensions[1] / 2);
imgPlaneY->GetTexturePlaneProperty()->SetOpacity(1);
imgPlaneY->GetPlaneProperty()->SetColor(1, 0.25, 0.0);
imgPlaneY->GetSelectedPlaneProperty()->SetColor(0, 1, 0);
//imgPlaneY->GetPlaneProperty()->SetOpacity(1.0);
imgPlaneY->GetPlaneProperty()->SetLineWidth(1);
imgPlaneZ->SetInputConnection(reader->GetOutputPort());
imgPlaneZ->SetPicker(picker);
imgPlaneZ->RestrictPlaneToVolumeOn();
imgPlaneZ->GetMarginProperty()->SetOpacity(0);
imgPlaneZ->SetMarginSizeX(0);
imgPlaneZ->SetMarginSizeY(0);
imgPlaneZ->DisplayTextOn();
imgPlaneZ->SetResliceInterpolateToLinear();
imgPlaneZ->SetPlaneOrientationToZAxes();
//imgPlaneZ->SetWindowLevel(imgBitDepthLevelScale, imgBitDepthLevelScale / 2.0, 0);
imgPlaneZ->SetSliceIndex(dimensions[2] / 2);
imgPlaneZ->GetTexturePlaneProperty()->SetOpacity(1);
imgPlaneZ->GetPlaneProperty()->SetColor(1, 0.25, 0.0);
imgPlaneZ->GetSelectedPlaneProperty()->SetColor(0, 1, 0);
//imgPlaneZ->GetPlaneProperty()->SetOpacity(1.0);
imgPlaneZ->GetPlaneProperty()->SetLineWidth(1);
imgPlaneX->SetDefaultRenderer(renderer);
imgPlaneY->SetDefaultRenderer(renderer);
imgPlaneZ->SetDefaultRenderer(renderer);