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;
337 static void UnRegisterCodecs();
345 vtkTypeBool ProcessRequest(
347 vtkInformation* request, vtkInformationVector** inputVector,
348 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
351 int RequestInformation(
352 vtkInformation* request, vtkInformationVector** inputVector,
353 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
357 vtkInformation* request, vtkInformationVector** inputVector,
358 vtkInformationVector* outputVector) VTK_DICOM_OVERRIDE;
362 virtual
bool ReadOverlays(vtkImageData *data);
367 const
void *filePtr, vtkIdType bitskip, vtkIdType count,
368 void *buffer, vtkIdType incr,
int bit);
372 virtual
bool ReadOneFile(
374 const
char *filename,
int idx,
375 unsigned char *buffer, vtkIdType bufferSize);
378 void MaskBits(
void *buffer, vtkIdType bufferSize,
int scalarSize,
379 int bitsStored,
int pixelRepresentation);
383 const
void *source,
void *buffer, vtkIdType bufferSize,
int bits);
387 const
void *source,
void *buffer, vtkIdType bufferSize, vtkIdType rowlen);
390 virtual
bool ReadFileNative(
391 const
char *filename,
int idx,
392 unsigned char *buffer, vtkIdType bufferSize);
395 virtual
bool ReadFileDelegated(
396 const
char *filename,
int idx,
397 unsigned char *buffer, vtkIdType bufferSize);
401 virtual
int ComputeRescaledScalarType(
403 int scalarType,
int bitsStored,
int pixelRepresentation);
406 virtual
void RescaleBuffer(
407 int fileIdx,
int frameIdx,
int fileType,
int outputType,
408 int numFileComponents,
int numComponents,
409 void *fileBuffer,
void *outputBuffer, vtkIdType bufferSize);
412 virtual
void YBRToRGB(
413 int fileIdx,
int frameIdx,
void *buffer, vtkIdType bufferSize);
417 void RelayError(
vtkObject *o,
unsigned long e,
void *data);
427 virtual
bool ValidateStructure(
428 vtkIntArray *fileArray, vtkIntArray *frameArray);
431 virtual
void SortFiles(vtkIntArray *fileArray, vtkIntArray *frameArray);
434 void NoSortFiles(vtkIntArray *fileArray, vtkIntArray *frameArray);
438 virtual
void UpdateMedicalImageProperties();
446 double RescaleIntercept;
450 vtkMatrix4x4 *PatientMatrix;
456 vtkMedicalImageProperties *MedicalImageProperties;
462 bool OverrideCharacterSet;
471 vtkTypeInt64Array *FileOffsetArray;
474 vtkIntArray *FileIndexArray;
477 vtkIntArray *FrameIndexArray;
480 vtkStringArray *StackIDs;
489 int OutputScalarType;
499 int NumberOfPackedComponents;
502 int NumberOfPlanarComponents;
507 int DesiredTimeIndex;
511 char DesiredStackID[20];
514 unsigned short OverlayBitfield;
515 bool UpdateOverlayFlag;
518 #ifdef VTK_DICOM_DELETE
533 class VTKDICOM_EXPORT vtkDICOMReaderInitializer
536 vtkDICOMReaderInitializer();
537 ~vtkDICOMReaderInitializer();
539 vtkDICOMReaderInitializer(
const vtkDICOMReaderInitializer&);
540 vtkDICOMReaderInitializer& operator=(
const vtkDICOMReaderInitializer&);
543 static vtkDICOMReaderInitializer vtkDICOMReaderInitializerInstance;
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.
static void RegisterCodecs()
Control registration of image codecs (DCMTK-specific).
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