// n*2D to 3D
vtkImageData* out = vtkImageData::New();
// out->CopyStructure(first);
- out->SetScalarType(first->GetScalarType());
- out->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
int ext[6];
//first->GetExtent(ext); // JPR
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
first->GetWholeExtent(ext); // renvoie egalement 0,0 en Z // JPR
+#else
+ first->GetExtent(ext); // renvoie egalement 0,0 en Z // JPR
+#endif
if(ext[5] == 0)
{
int dim[3];
first->GetDimensions(dim);
-
out->SetDimensions(dim[0], dim[1], (int)im.size() );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ out->SetScalarType(first->GetScalarType());
+ out->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
out->AllocateScalars();
out->Update();
+#else
+ out->AllocateScalars(first->GetScalarType(),first->GetNumberOfScalarComponents());
+#endif
unsigned long imsize = dim[0] * dim[1];
imsize = imsize * dim[2] ; // deal with multiframes // JPR
OutStrGimmick out;
vtkImageData* first = mReader.GetImage( im.front());
out.img = vtkImageData::New();
- out.img->SetScalarType(first->GetScalarType());
- out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
first->GetWholeExtent(ext); // send also 0,0 in Z
+#else
+ first->GetExtent(ext); // send also 0,0 in Z
+#endif
if(ext[5] == 0)
{
ext[5] = (int)im.size()-1;
first->GetSpacing(spac);
out.img->SetSpacing(spac);
out.img->SetDimensions(dim[0], dim[1], (int)im.size() );
+
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ out.img->SetScalarType(first->GetScalarType());
+ out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
out.img->AllocateScalars();
out.img->Update();
+#else
+ out.img->AllocateScalars(first->GetScalarType(), first->GetNumberOfScalarComponents());
+#endif
+
+
unsigned long imsize = dim[0] * dim[1];
imsize = imsize * dim[2] ; // deal with multiframes here
// differents formats char , short, etc...
{
OutStrGimmick out;
out.img = vtkImageData::New();
- out.img->SetScalarType(first->GetScalarType());
out.img->SetSpacing(spac);
- out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
first->GetWholeExtent(ext); // send also 0,0 in Z
+#else
+ first->GetExtent(ext); // send also 0,0 in Z
+#endif
ext[5] = 0;
out.img->SetExtent(ext);
-
out.img->SetDimensions(dim[0], dim[1], 1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ out.img->SetScalarType(first->GetScalarType());
+ out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
out.img->AllocateScalars();
out.img->Update();
+#else
+ out.img->AllocateScalars(first->GetScalarType(),first->GetNumberOfScalarComponents());
+#endif
+
+
memcpy(out.img->GetScalarPointer(0,0,0), cur->GetScalarPointer(0,0,slice), imsize);
o_output.push_back(out);
}
{
OutStrGimmick out;
out.img = vtkImageData::New();
- out.img->SetScalarType(first->GetScalarType());
- out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
int ext[6];
- double spac[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
first->GetWholeExtent(ext); // send also 0,0 in Z
+#else
+ first->GetExtent(ext); // send also 0,0 in Z
+#endif
+
+ double spac[6];
ext[5] = 0;
out.img->SetExtent(ext);
first->GetSpacing(spac);
out.img->SetSpacing(spac);
out.img->SetDimensions(dim[0], dim[1], (int)im.size() );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ out.img->SetScalarType(first->GetScalarType());
+ out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
out.img->AllocateScalars();
out.img->Update();
+#else
+ out.img->AllocateScalars(first->GetScalarType(), first->GetNumberOfScalarComponents());
+#endif
+
unsigned long imsize = dim[0] * dim[1];
imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
int index = 0;
dim[0] = dim[1] = 128;
dim[2] = 1;
mUnreadableImage->SetDimensions ( dim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mUnreadableImage->SetScalarTypeToUnsignedChar();
- mUnreadableImage->AllocateScalars();
+ mUnreadableImage->AllocateScalars();
+#else
+ mUnreadableImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
+
for (int i=0;i<dim[0];i++)
for (int j=0;j<dim[1];j++)
mUnreadableImage->SetScalarComponentFromFloat(i,j,0,0,0);
// std::cout << "user="<<p->GetUser() <<std::endl;
if ( p->GetUser() == this )
+ {
GetMultiThreadImageReaderUserMutex().Unlock();
+ }
p->GetUser()->MultiThreadImageReaderSendEvent
(p->GetFilename(),
// wxMutexLocker lock(GetMultiThreadImageReaderUserMutex());
mUnloadQueue.insert(p);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
p->GetImage()->UpdateInformation();
p->GetImage()->PropagateUpdateExtent();
long ImMem = p->GetImage()->GetEstimatedMemorySize();
+#else
+ int ext[6];
+ int dim[3];
+ p->GetImage()->GetExtent(ext);
+ dim[0] = ext[1]-ext[0]+1;
+ dim[1] = ext[3]-ext[2]+1;
+ dim[2] = ext[5]-ext[4]+1;
+ long ImMem = dim[0]*dim[1]*dim[2]*p->GetImage()->GetScalarSize();;
+#endif
mTotalMem += ImMem;
GimmickMessage(5,"==> Image in memory = "<<mUnloadQueue.size()<<std::endl);
std::string filename = unload->GetFilename();
GimmickMessage(5,"'" << filename << "'" << std::endl);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mTotalMem -= unload->GetImage()->GetEstimatedMemorySize();
+#else
+ int ext[6];
+ int dim[3];
+ unload->GetImage()->GetExtent(ext);
+ dim[0] = ext[1]-ext[0]+1;
+ dim[1] = ext[3]-ext[2]+1;
+ dim[2] = ext[5]-ext[4]+1;
+ mTotalMem -= dim[0]*dim[1]*dim[2]*unload->GetImage()->GetScalarSize();
+#endif
GimmickMessage(5," ==> Total mem = "<<mTotalMem<<" Ko "<<std::endl);
int outputdims[3];
imageIn->GetDimensions (inputdims);
unsigned short *input = (unsigned short *)(imageIn->GetScalarPointer());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageIn->Update();
+#else
+ // ..
+#endif
+
unsigned int div = (unsigned int)ceil(sqrt( (double)numberOfImagesInMosaic ) );
outputdims[0] = inputdims[0] / div;
vtkImageOut = vtkImageData::New();
vtkImageOut->SetDimensions( outputdims );
vtkImageOut->SetExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkImageOut->SetWholeExtent(0,outputdims[0]-1,0,outputdims[1]-1,0,outputdims[2]-1);
vtkImageOut->SetNumberOfScalarComponents(1);
//vtkImageOut->SetSpacing( blabla );
vtkImageOut->SetScalarType( VTK_UNSIGNED_SHORT );
vtkImageOut->AllocateScalars();
vtkImageOut->Update();
+#else
+ vtkImageOut->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
unsigned short *output =(unsigned short *)(vtkImageOut->GetScalarPointer());
connector->Update();
vtkImageData *im = vtkImageData::New();
im->ShallowCopy(connector->GetOutput());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
im->Update();
+#else
+ im->Modified();
+#endif
+
+
m_Vresults.push_back(im);
}
first->GetDimensions(dim);
if (dim[2]==1)
{
- vtkImageData *out;
- out = vtkImageData::New();
- out->SetScalarType(first->GetScalarType());
- out->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
+ vtkImageData *out = vtkImageData::New();
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
first->GetWholeExtent(ext);
+#else
+ first->GetExtent(ext);
+#endif
if(ext[5] == 0)
{
ext[5] = getImagesSelected().size()-1;
}
out->SetSpacing(spac);
out->SetDimensions(dim[0], dim[1], getImagesSelected().size() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+
+ out->SetScalarType(first->GetScalarType());
+ out->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
out->AllocateScalars();
out->Update();
+#else
+ out->AllocateScalars(first->GetScalarType(),first->GetNumberOfScalarComponents());
+#endif
+
+
unsigned long imsize = dim[0] * dim[1];
imsize = imsize * dim[2]; // deal with multiframes here
// differents formats char , short, etc...
<<std::endl);
if (im==0) return;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mViewer->SetInput(im);
+#else
+ mViewer->SetInputData(im);
+#endif
mViewer->SetSlice( 0 );
int x1,x2,y1,y2,z1,z2;
double spx,spy,spz;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
im->Update();
+#else
+ // ...
+#endif
+
//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); // JPR
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
im->GetWholeExtent (x1,x2,y1,y2,z1,z2);
+#else
+ im->GetExtent (x1,x2,y1,y2,z1,z2);
+#endif
+
+
/*
std::cout << "in WxViewer::ShowImage GetWholeExtent ext =";
std::cout << " [x1]=" << x1;