_pts = vtkPoints::New();
_pts->SetNumberOfPoints(8);
- _pts->SetPoint(0, -1000 , -1000 , 0 );
- _pts->SetPoint(1, 1000 , -1000 , 0 );
- _pts->SetPoint(2, 1000 , 1000 , 0 );
- _pts->SetPoint(3, -1000 , 1000 , 0 );
- _pts->SetPoint(4, -1000 , 1000 , 0 );
- _pts->SetPoint(5, -1000 , 1000 , 0 );
- _pts->SetPoint(6, -1000 , 1000 , 0 );
- _pts->SetPoint(7, -1000 , 1000 , 0 );
+//EED
+// _pts->SetPoint(0, -1000 , -1000 , 0 );
+// _pts->SetPoint(1, 1000 , -1000 , 0 );
+// _pts->SetPoint(2, 1000 , 1000 , 0 );
+// _pts->SetPoint(3, -1000 , 1000 , 0 );
+// _pts->SetPoint(4, -1000 , 1000 , 0 );
+// _pts->SetPoint(5, -1000 , 1000 , 0 );
+// _pts->SetPoint(6, -1000 , 1000 , 0 );
+// _pts->SetPoint(7, -1000 , 1000 , 0 );
vtkCellArray *lines = vtkCellArray::New();
lines->InsertNextCell(17);
_pts->SetPoint(5, x+range, y+range, posZ+range);
_pts->SetPoint(6, x+range, y-range, posZ+range);
_pts->SetPoint(7, x-range, y-range, posZ+range);
+
+//EED 2017-03-02
+ _pts->Modified();
}
}
if(_vtkmprbasedata->GetImageData())
{
+ _vtkmprbasedata->GetImageData()->Update();
+ _vtkmprbasedata->GetImageData()->Modified();
_vtkmprbasedata->GetImageData()->GetScalarRange(range);
delta = range[1]-range[0];
-
+ if (delta==0)
+ {
+ printf("EED vtkMPR3DDataViewer::Configure Warning! image Range [0,0] -> changed to [0,1000] \n" );
+ delta=1000;
+ } // if delta
+
_ctFunVectorPoint.clear();
- _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 );
+ _ctFunVectorPoint.push_back( range[0] + delta*0/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*1/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*2/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*3/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*4/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*5/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*6/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*7/8 );
+ _ctFunVectorPoint.push_back( range[0] + delta*8/8 );
_ctFunVectorRed.clear();
_ctFunVectorRed.push_back(0.0);
- _ctFunVectorRed.push_back(1.0);
_ctFunVectorRed.push_back(0.0);
_ctFunVectorRed.push_back(0.0);
_ctFunVectorRed.push_back(0.0);
+ _ctFunVectorRed.push_back(0.5);
+ _ctFunVectorRed.push_back(1.0);
+ _ctFunVectorRed.push_back(1.0);
+ _ctFunVectorRed.push_back(1.0);
+ _ctFunVectorRed.push_back(0.5);
_ctFunVectorGreen.clear();
_ctFunVectorGreen.push_back(0.0);
_ctFunVectorGreen.push_back(0.0);
- _ctFunVectorGreen.push_back(0.0);
+ _ctFunVectorGreen.push_back(0.5);
+ _ctFunVectorGreen.push_back(1.0);
+ _ctFunVectorGreen.push_back(1.0);
_ctFunVectorGreen.push_back(1.0);
- _ctFunVectorGreen.push_back(0.2);
+ _ctFunVectorGreen.push_back(0.5);
+ _ctFunVectorGreen.push_back(0.0);
+ _ctFunVectorGreen.push_back(0.0);
_ctFunVectorBlue.clear();
+ _ctFunVectorBlue.push_back(0.5);
+ _ctFunVectorBlue.push_back(1.0);
+ _ctFunVectorBlue.push_back(1.0);
+ _ctFunVectorBlue.push_back(1.0);
+ _ctFunVectorBlue.push_back(0.5);
_ctFunVectorBlue.push_back(0.0);
_ctFunVectorBlue.push_back(0.0);
- _ctFunVectorBlue.push_back(1.0);
_ctFunVectorBlue.push_back(0.0);
_ctFunVectorBlue.push_back(0.0);
// specifying the DisplayExtent, the pipeline requests data of this extent
// and the vtkImageMapToColors only processes a slice of data.
- if(_saggitalColors==NULL){
+ if(_saggitalColors==NULL)
+ {
_saggitalColors = vtkImageMapToColors::New();
}
_saggitalColors->RemoveAllInputs();
_saggitalColors->SetLookupTable(_ctfun);
- if(_saggital==NULL){
+ if(_saggital==NULL)
+ {
_saggital = vtkImageActor::New();
_saggital->SetInput(_saggitalColors->GetOutput());
}
// same approach as before except that the extent differs.
- if(_axialColors==NULL){
+ if(_axialColors==NULL)
+ {
_axialColors = vtkImageMapToColors::New();
}
// _axialColors->SetLookupTable(_hueLut);
_axialColors->SetLookupTable(_ctfun);
- if(_axial==NULL){
+ if(_axial==NULL)
+ {
_axial = vtkImageActor::New();
_axial->SetInput(_axialColors->GetOutput());
}
// Create the third (coronal) plane of the three planes. We use
// the same approach as before except that the extent differs.
- if(_coronalColors==NULL){
+ if(_coronalColors==NULL)
+ {
_coronalColors = vtkImageMapToColors::New();
}
_coronalColors->RemoveAllInputs();
// _coronalColors->SetLookupTable(_satLut);
_coronalColors->SetLookupTable(_ctfun);
- if(_coronal==NULL){
+ if(_coronal==NULL)
+ {
_coronal = vtkImageActor::New();
_coronal->SetInput(_coronalColors->GetOutput());
}
// An outline provides context around the data.
//
- if(_outlineData==NULL){
+ if(_outlineData==NULL)
+ {
_outlineData = vtkOutlineFilter::New();
}
_outlineData->RemoveAllInputs();
- if(_vtkmprbasedata->GetImageData()){
+ if(_vtkmprbasedata->GetImageData())
+ {
_outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
}
- if(_mapOutline==NULL){
+ if(_mapOutline==NULL)
+ {
_mapOutline = vtkPolyDataMapper::New();
_mapOutline->SetInput(_outlineData->GetOutput());
}
_mapOutline->Update();
//_mapOutline->RemoveAllInputs();
- if(_outline==NULL){
+ if(_outline==NULL)
+ {
_outline = vtkActor::New();
_outline->SetMapper(_mapOutline);
_outline->GetProperty()->SetColor(0,0,0);
}
}
-
-
-
-
-
-
//int ext[6];
//_vtkmprbasedata->GetImageData()->GetExtent(ext);
-
-
-
-
}
//-------------------------------------------------------------------
return _visiblePosition[idPosition];
}
-void vtkMPR3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
+void vtkMPR3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable)
+{
if(_saggitalColors)
{
_saggitalColors->SetLookupTable(colortable);
{
if(_planeWidgetX)
{
- if (ok==true)
- {
+ if (ok==true)
+ {
//EED 21/07/2013
// 1. Make backup of actors
// 2. Putting out all the actors
// 5. Refresh
// step 1, step 2
- vtkActorCollection *tmpCollection = vtkActorCollection::New();
+ vtkActorCollection *tmpCollection = vtkActorCollection::New();
vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors();
- int i,size=collectionActors->GetNumberOfItems();
+ int i,size=collectionActors->GetNumberOfItems();
for (i=0; i<size; i++)
{
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
// step 5 Refresh
_wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
- } // if ok
+ } // if ok
if ((plane==1) && (ok==false)) _planeWidgetX->EnabledOff();
if ((plane==2) && (ok==false)) _planeWidgetY->EnabledOff();
if ((plane==3) && (ok==false)) _planeWidgetZ->EnabledOff();
spc[1] = 0;
spc[2] = 0;
}
- //this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetSpacing(spc);
+
+// GetVtkMPR3DDataViewer()->Configure();
+
//double nx=1,ny=0,nz=0; // JPRx
Refresh();
SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
-
double normal[3];
// FreePlaneX
_planeWidgetX->GetNormal(normal);
y=y*spc[1];
z=z*spc[2];
- if(_pointWidget){
+ if(_pointWidget)
+ {
+ _pointWidget->SetInput( image );
+ _pointWidget->PlaceWidget();
+
_pointWidget->SetPosition( x,y,z );
double in[3];
double normal[3];
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
}
+
+ if (_wxvtkmpr3DviewCntrlPanel!=NULL)
+ {
+ _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel(false);
+ } // if _wxvtkmpr3DviewCntrlPanel
}
//-------------------------------------------------------------------
int i,size=collectionActors->GetNumberOfItems();
for (i=0; i<size; i++)
{
- printf(" wxVtkMPR3DView::VisibleImageActor %d\n" , i);
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for