22 #ifndef vtkDICOMReader_h
23 #define vtkDICOMReader_h
25 #include "vtkImageReader2.h"
26 #include "vtkDICOMModule.h"
27 #include "vtkDICOMConfig.h"
28 #include "vtkDICOMCharacterSet.h"
31 #if defined(VTK_ABI_NAMESPACE_BEGIN)
32 VTK_ABI_NAMESPACE_BEGIN
36 class vtkTypeInt64Array;
39 class vtkMedicalImageProperties;
41 #if defined(VTK_ABI_NAMESPACE_BEGIN)
50 #ifndef VTK_TYPE_BOOL_TYPEDEFED
51 #define VTK_TYPE_BOOL_TYPEDEFED
52 typedef int vtkTypeBool;
65 void PrintSelf(ostream& os, vtkIndent indent) VTK_DICOM_OVERRIDE;
88 const char *GetDesiredStackID() {
return this->DesiredStackID; }
147 return this->DefaultCharacterSet; }
155 vtkSetMacro(OverrideCharacterSet,
bool);
156 vtkBooleanMacro(OverrideCharacterSet,
bool);
157 bool GetOverrideCharacterSet() {
158 return this->OverrideCharacterSet; }
162 vtkGetMacro(Sorting,
int);
164 vtkSetMacro(Sorting,
int);
165 vtkBooleanMacro(Sorting,
int);
187 vtkGetMacro(TimeAsVector,
int);
188 vtkSetMacro(TimeAsVector,
int);
189 vtkBooleanMacro(TimeAsVector,
int);
193 int GetTimeDimension() {
return this->TimeDimension; }
195 double GetTimeSpacing() {
return this->TimeSpacing; }
199 vtkSetMacro(DesiredTimeIndex,
int);
201 vtkGetMacro(DesiredTimeIndex,
int);
210 vtkGetMacro(AutoYBRToRGB,
int);
211 vtkSetMacro(AutoYBRToRGB,
int);
212 vtkBooleanMacro(AutoYBRToRGB,
int);
227 vtkGetMacro(AutoRescale,
int);
228 vtkSetMacro(AutoRescale,
int);
229 vtkBooleanMacro(AutoRescale,
int);
245 double GetRescaleIntercept() {
return this->RescaleIntercept; }
268 vtkAlgorithmOutput *GetOverlayOutputPort();
269 void SetOverlayOutput(vtkImageData *data);
279 vtkMedicalImageProperties *GetMedicalImageProperties();
294 void SetMemoryRowOrderToFileNative() {
295 this->SetMemoryRowOrder(FileNative); }
296 void SetMemoryRowOrderToTopDown() {
297 this->SetMemoryRowOrder(TopDown); }
298 void SetMemoryRowOrderToBottomUp() {
299 this->SetMemoryRowOrder(BottomUp); }
300 int GetMemoryRowOrder() {
return this->MemoryRowOrder; }
301 const char *GetMemoryRowOrderAsString();
314 vtkSetMacro(OutputScalarType,
int);
315 vtkGetMacro(OutputScalarType,
int);
320 using Superclass::Update;
331 vtkTypeBool ProcessRequest(
333 vtkInformation* request, vtkInformationVector** inputVector,
334 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
337 int RequestInformation(
338 vtkInformation* request, vtkInformationVector** inputVector,
339 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
343 vtkInformation* request, vtkInformationVector** inputVector,
344 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
348 virtual
bool ReadOverlays(vtkImageData *data);
353 const
void *filePtr, vtkIdType bitskip, vtkIdType count,
354 void *buffer, vtkIdType incr,
int bit);
358 virtual
bool ReadOneFile(
360 const
char *filename,
int idx,
361 unsigned char *buffer, vtkIdType bufferSize);
364 void MaskBits(
void *buffer, vtkIdType bufferSize,
int scalarSize,
365 int bitsStored,
int pixelRepresentation);
369 const
void *source,
void *buffer, vtkIdType bufferSize,
int bits);
373 const
void *source,
void *buffer, vtkIdType bufferSize, vtkIdType rowlen);
376 virtual
bool ReadFileNative(
377 const
char *filename,
int idx,
378 unsigned char *buffer, vtkIdType bufferSize);
381 virtual
bool ReadFileDelegated(
382 const
char *filename,
int idx,
383 unsigned char *buffer, vtkIdType bufferSize);
387 virtual
int ComputeRescaledScalarType(
389 int scalarType,
int bitsStored,
int pixelRepresentation);
392 virtual
void RescaleBuffer(
393 int fileIdx,
int frameIdx,
int fileType,
int outputType,
394 int numFileComponents,
int numComponents,
395 void *fileBuffer,
void *outputBuffer, vtkIdType bufferSize);
398 virtual
void YBRToRGB(
399 int fileIdx,
int frameIdx,
void *buffer, vtkIdType bufferSize);
403 void RelayError(
vtkObject *o,
unsigned long e,
void *data);
413 virtual
bool ValidateStructure(
414 vtkIntArray *fileArray, vtkIntArray *frameArray);
417 virtual
void SortFiles(vtkIntArray *fileArray, vtkIntArray *frameArray);
420 void NoSortFiles(vtkIntArray *fileArray, vtkIntArray *frameArray);
424 virtual
void UpdateMedicalImageProperties();
432 double RescaleIntercept;
436 vtkMatrix4x4 *PatientMatrix;
442 vtkMedicalImageProperties *MedicalImageProperties;
448 bool OverrideCharacterSet;
457 vtkTypeInt64Array *FileOffsetArray;
460 vtkIntArray *FileIndexArray;
463 vtkIntArray *FrameIndexArray;
466 vtkStringArray *StackIDs;
475 int OutputScalarType;
485 int NumberOfPackedComponents;
488 int NumberOfPlanarComponents;
493 int DesiredTimeIndex;
497 char DesiredStackID[20];
500 unsigned short OverlayBitfield;
501 bool UpdateOverlayFlag;
504 #ifdef VTK_DICOM_DELETE
Character sets.
Definition: vtkDICOMCharacterSet.h:55
A meta data reader for DICOM data.
Definition: vtkDICOMParser.h:48
Read DICOM image files.
Definition: vtkDICOMReader.h:57
void PrintSelf(ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
Print information about this object.
vtkIntArray * GetFrameIndexArray()
Get an array that converts slice index to frame index.
Definition: vtkDICOMReader.h:120
bool HasOverlay()
Returns true if any overlays are present.
Definition: vtkDICOMReader.h:272
void SetDefaultCharacterSet(vtkDICOMCharacterSet cs)
Set the character set to use if SpecificCharacterSet is missing.
vtkIntArray * GetFileIndexArray()
Get an array that converts slice index to input file index.
Definition: vtkDICOMReader.h:111
vtkImageData * GetOverlayOutput()
Get the overlay.
int CanReadFile(const char *filename) VTK_DICOM_OVERRIDE
Return true if this reader can read the given file.
vtkStringArray * GetStackIDs()
Get a list of the stacks that are present in the input files.
Definition: vtkDICOMReader.h:94
static vtkDICOMReader * New()
Static method for construction.
void SetSorter(vtkDICOMSliceSorter *sorter)
Set a custom sorter to be used to sort files and frames into slices.
void SetDesiredStackID(const char *stackId)
Set the Stack ID of the stack to load, for named stacks.
unsigned short GetOverlayBitfield()
Returns a bitfield that indicates which overlays are present.
Definition: vtkDICOMReader.h:275
double GetRescaleSlope()
Get the slope and intercept for rescaling the scalar values.
Definition: vtkDICOMReader.h:244
void Update() VTK_DICOM_OVERRIDE
Update both the image and, if present, the overlay.
const char * GetDescriptiveName() VTK_DICOM_OVERRIDE
Return a descriptive name that might be useful in a GUI.
Definition: vtkDICOMReader.h:73
vtkMatrix4x4 * GetPatientMatrix()
Get a matrix to place the image within DICOM patient coords.
Definition: vtkDICOMReader.h:255
vtkDICOMMetaData * GetMetaData()
Get the meta data for the DICOM files.
Definition: vtkDICOMReader.h:132
RowOrder
Enumeration for top-down vs. bottom-up ordering.
Definition: vtkDICOMReader.h:284
void SetMemoryRowOrder(int order)
Set the ordering of the image rows in memory.
Index a DICOM series to allow proper dimensional ordering.
Definition: vtkDICOMSliceSorter.h:43
Superclass of binary file readers.
Definition: vtkImageReader2.h:53
virtual const char * GetFileExtensions()
Definition: vtkImageReader2.h:289
abstract base class for most VTK objects
Definition: vtkObject.h:54