/// Create a tree view with a given name
void GimmickView::CreateSingleTreeView(std::string &i_name)
{
- this->CreateTreeView(mGimmick->GetTreeHandlerMap()[i_name]);
+ this->CreateTreeView(mGimmick->GetTreeHandlerMap()[i_name]);
}
}
i->second->UpdateLevel(l);
}
+
//======================================================================
/// Clears the status and begins a new selection process
void GimmickView::ResetExtent()
valid=true;
}
-
//======================================================================
//======================================================================
else
{
boost::shared_ptr<ImageExtent> ie=boost::shared_ptr<ImageExtent>(new ImageExtent((*sel).GetAttribute("D0028_0010"),
- (*sel).GetAttribute("D0028_0011"),
- (*sel).GetAttribute("D0028_0012"),
- ""));
+ (*sel).GetAttribute("D0028_0011"),
+ (*sel).GetAttribute("D0028_0012"),
+ ""));
if(mImageExtent==0)
{
mImageExtent=ie;
{
std::stringstream out;
out << mImageExtent->GetDimension() << "D image " << mImageExtent->Get(0) << "x"<< mImageExtent->Get(1) << "x"<< mImageExtent->Get(2) <<" selected";
- mMessage = out.str();
+ mMessage = out.str();
mImageExtent->SetDimension(2);
valid=true;
}
}
else
{
- mImageExtent->Add(*ie);
- std::stringstream out;
- out << mImageExtent->GetDimension() << "D image " << mImageExtent->Get(0) << "x"<< mImageExtent->Get(1) << "x"<< mImageExtent->Get(2) <<" selected";
- mMessage = out.str();
+ mImageExtent->Add(*ie);
+ std::stringstream out;
+ out << mImageExtent->GetDimension() << "D image " << mImageExtent->Get(0) << "x"<< mImageExtent->Get(1) << "x"<< mImageExtent->Get(2) <<" selected";
+ mMessage = out.str();
}
}
else
// Only one image : give it
vtkImageData* out = vtkImageData::New();
GimmickDebugMessage(3, "State Check: Full Filename: "
- <<im.front()
- <<std::endl);
+ <<im.front()
+ <<std::endl);
out->ShallowCopy(mReader.GetImage(im.front()));
s.push_back( out );
}
else if (im.size()>1) // Test inutile ? JPR
{
vtkImageData* first = mReader.GetImage( im.front());
- if (dimension == 2)
+ if (dimension == 2)
{
// n3D
std::vector<std::string>::iterator it;
out->CopyStructure(first);
out->SetScalarType(first->GetScalarType());
int ext[6];
- first->GetExtent(ext);
+ //first->GetExtent(ext); // JPR
+ first->GetWholeExtent(ext);
+std::cout <<"in GimmickView::ReadImagesNotThreaded GetWholeExtent ext =";
+for (int jjj=0;jjj<6;jjj++)
+ std:cout << " [" << jjj << "]=" << ext[jjj];
+std::cout << endl;
+
if(ext[5] == 0)
{
ext[5] = im.size()-1;
//=====================================================================
void WxViewer::ShowImage(vtkImageData* im)
{
-
GimmickDebugMessage(6,"WxViewer::ShowImage"
<<std::endl);
if (im==0) return;
mViewer->SetInput(im);
-
+
mViewer->SetSlice( 0 );
-
+
int x1,x2,y1,y2,z1,z2;
double spx,spy,spz;
im->Update();
-
+
+//std::cout << "in WxViewer::ShowImage PrintSelf() =";
+//im->PrintSelf(std::cout, vtkIndent(2));
+
im->GetSpacing(spx,spy,spz);
- im->GetExtent (x1,x2,y1,y2,z1,z2);
-
+ //im->GetExtent (x1,x2,y1,y2,z1,z2); // JPR
+ im->GetWholeExtent (x1,x2,y1,y2,z1,z2);
+/*
+std::cout << "in WxViewer::ShowImage GetWholeExtent ext =";
+ std::cout << " [x1]=" << x1;
+ std::cout << " [x2]=" << x2;
+ std::cout << " [y1]=" << y1;
+ std::cout << " [y2]=" << y2;
+ std::cout << " [z1]=" << z1;
+ std::cout << " [z2]=" << z2;
+std::cout << std::endl;
+*/
if ((x1!=mx1) ||
(x2!=mx2) ||
(y1!=my1) ||
mspx = spx;
mspy = spy;
mspz = spz;
-
+
double *range = im->GetScalarRange();
- mViewer->SetColorWindow(range[1] - range[0]);
- mViewer->SetColorLevel(0.5 * (range[1] + range[0]));
-
+ mViewer->SetColorWindow(range[1] - range[0]);
+ mViewer->SetColorLevel(0.5 * (range[1] + range[0]));
- mViewer->GetRenderer()->ResetCamera();
+ mViewer->GetRenderer()->ResetCamera();
double bounds[6];
+ mViewer->GetRenderer()->ComputeVisiblePropBounds(bounds);
- mViewer->GetRenderer()->ComputeVisiblePropBounds(bounds);
-
-
- mViewer->GetRenderer()->ResetCameraClippingRange(bounds);
- mViewer->GetRenderer()->SetBackground(0.1,0.1,0.2);
-
-
-
- }
-
+ mViewer->GetRenderer()->ResetCameraClippingRange(bounds);
+ mViewer->GetRenderer()->SetBackground(0.1,0.1,0.2);
+ }
}
//================================================================
- //================================================================
+ //================================================================
bool WxViewer::RefreshIfNecessary()
{
if (mNeedRefresh)