+
+
+vtkImageData* GetXCoherentInfoGdcmReader::CreateDefaultImage()
+{
+ int i;
+ int sizeX, sizeY, sizeZ;
+ sizeX = 200;
+ sizeY = sizeX;
+ sizeZ = 1;
+ vtkImageData *newImage = vtkImageData::New();
+ newImage->Initialize();
+ newImage->SetSpacing( 1,1,1 );
+ newImage->SetDimensions( sizeX,sizeY,sizeZ );
+ newImage->SetExtent(0, sizeX-1,0,sizeY-1,0,sizeZ-1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ newImage->SetWholeExtent(0, sizeX-1,0,sizeY-1,0,sizeZ-1 );
+ newImage->SetScalarTypeToUnsignedChar();
+ newImage->SetNumberOfScalarComponents(1);
+ newImage->AllocateScalars();
+ newImage->Update();
+#else
+ newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
+
+ memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 );
+ for (i=0; i<sizeX; i++)
+ {
+ newImage->SetScalarComponentFromDouble(i,i,0, 0, 255 );
+ newImage->SetScalarComponentFromDouble(i,sizeY-1-i,0, 0, 255 );
+ } // for i
+ return newImage;
+}
+
+