}
vtkGdcmReader::~vtkGdcmReader()
-{
+{
this->RemoveAllFileName();
this->InternalFileNameList.clear();
if(this->LookupTable)
// Print
void vtkGdcmReader::PrintSelf(ostream& os, vtkIndent indent)
{
- vtkImageReader::PrintSelf(os,indent);
- os << indent << "Filenames : " << endl;
- vtkIndent nextIndent = indent.GetNextIndent();
- for (std::list<std::string>::iterator FileName = FileNameList.begin();
- FileName != FileNameList.end();
- ++FileName)
- {
- os << nextIndent << FileName->c_str() << endl ;
- }
+ vtkImageReader::PrintSelf(os,indent);
+ os << indent << "Filenames : " << endl;
+ vtkIndent nextIndent = indent.GetNextIndent();
+ for (std::list<std::string>::iterator FileName = FileNameList.begin();
+ FileName != FileNameList.end();
+ ++FileName)
+ {
+ os << nextIndent << FileName->c_str() << endl ;
+ }
}
//-----------------------------------------------------------------------------
vtkDebugMacro("32 bits signed image");
this->SetDataScalarTypeToInt();
}
-
+ else if ( ImageType == "FD" )
+ {
+ vtkDebugMacro("64 bits Double image");
+ this->SetDataScalarTypeToDouble();
+ }
//Set number of scalar components:
this->SetNumberOfScalarComponents(this->NumComponents);
- vtkImageReader::ExecuteInformation();
+ this->Superclass::ExecuteInformation();
}
/*
* this->TotalNumberOfPlanes * this->NumComponents;
size_t stack_size = StackNumPixels * this->PixelSize;
// Allocate pixel data space itself.
- unsigned char *mem = new unsigned char [stack_size];
// Variables for the UpdateProgress. We shall use 50 steps to signify
// the advance of the process:
unsigned long UpdateProgressCount = 0;
// Feeling the allocated memory space with each image/volume:
- unsigned char * Dest = mem;
+ unsigned char *Dest = (unsigned char *)data->GetPointData()->GetScalars()->GetVoidPointer(0);
for (std::list<std::string>::iterator FileName = InternalFileNameList.begin();
FileName != InternalFileNameList.end();
++FileName)
}
} // Else, file not loadable
} // Loop on files
-
- // The "size" of the vtkScalars data is expressed in number of points,
- // and is not the memory size representing those points:
- data->GetPointData()->GetScalars()->SetVoidArray(mem, StackNumPixels, 0);
- //don't know why it's here, it's calling one more time ExecuteInformation:
- //this->Modified();
}
}
size_t size;
// If the data structure of vtk for image/volume representation
- // were straigthforwards the following would suffice:
+ // were straigthforwards the following would be enough:
// GdcmFile.GetImageDataIntoVector((void*)Dest, size);
// But vtk chooses to invert the lines of an image, that is the last
// line comes first (for some axis related reasons?). Hence we need
int LineSize = NumComponents * NumColumns * GdcmFile.GetHeader()->GetPixelSize();
unsigned char * Source;
+
if( GdcmFile.GetHeader()->HasLUT() )
{
size = GdcmFile.GetImageDataSizeRaw();
}
//GetImageData allocate a (void*)malloc, remove it:
free(pSource);
-
return size;
}