14 #ifndef vtkDICOMDirectory_h
15 #define vtkDICOMDirectory_h
17 #include "vtkAlgorithm.h"
18 #include "vtkDICOMModule.h"
19 #include "vtkDICOMConfig.h"
20 #include "vtkDICOMCharacterSet.h"
21 #include "vtkVersion.h"
24 #if defined(VTK_ABI_NAMESPACE_BEGIN)
25 VTK_ABI_NAMESPACE_BEGIN
31 #if defined(VTK_ABI_NAMESPACE_BEGIN)
50 void PrintSelf(ostream& os, vtkIndent indent) VTK_DICOM_OVERRIDE;
55 PATIENT, STUDY, SERIES, IMAGE, FRAME
68 const char *GetDirectoryName() {
return this->DirectoryName; }
77 vtkStringArray *GetInputFileNames() {
return this->InputFileNames; }
96 const char *GetFilePattern() {
return this->FilePattern; }
106 vtkSetMacro(ScanDepth,
int);
107 int GetScanDepth() {
return this->ScanDepth; }
124 void SetFindLevelToImage() { this->SetFindLevel(IMAGE); }
125 void SetFindLevelToSeries() { this->SetFindLevel(SERIES); }
126 int GetFindLevel() {
return this->FindLevel; }
137 #if (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION > 0) || VTK_MAJOR_VERSION > 7
138 vtkTypeBool
Update(vtkInformation *) VTK_DICOM_OVERRIDE {
139 this->Update();
return 1; }
140 vtkTypeBool
Update(
int i, vtkInformationVector *) VTK_DICOM_OVERRIDE {
141 this->Update(i);
return 1; }
146 int GetNumberOfSeries();
177 int GetFirstSeriesForStudy(
int study);
209 void SetQueryFilesToNever() { this->SetQueryFiles(0); }
210 void SetQueryFilesToDefault() { this->SetQueryFiles(-1); }
211 vtkSetMacro(QueryFiles,
int);
212 int GetQueryFiles() {
return this->QueryFiles; }
215 const char *GetFileSetID() {
return this->FileSetID; }
220 const char *GetInternalFileName() {
return this->InternalFileName; }
230 vtkSetMacro(IgnoreDicomdir,
int);
231 vtkBooleanMacro(IgnoreDicomdir,
int);
232 int GetIgnoreDicomdir() {
return this->IgnoreDicomdir; }
241 vtkSetMacro(RequirePixelData,
int);
242 vtkBooleanMacro(RequirePixelData,
int);
243 int GetRequirePixelData() {
return this->RequirePixelData; }
247 vtkSetMacro(FollowSymlinks,
int);
249 vtkBooleanMacro(FollowSymlinks,
int);
250 int GetFollowSymlinks() {
return this->FollowSymlinks; }
259 vtkSetMacro(ShowHidden,
int);
260 vtkBooleanMacro(ShowHidden,
int);
261 int GetShowHidden() {
return this->ShowHidden; }
275 return this->DefaultCharacterSet; }
283 vtkSetMacro(OverrideCharacterSet,
bool);
284 vtkBooleanMacro(OverrideCharacterSet,
bool);
285 bool GetOverrideCharacterSet() {
286 return this->OverrideCharacterSet; }
293 const
char *DirectoryName;
294 vtkStringArray *InputFileNames;
295 const
char *FilePattern;
298 int RequirePixelData;
303 bool OverrideCharacterSet;
305 vtkTimeStamp UpdateTime;
306 char *InternalFileName;
309 virtual
void Execute();
325 virtual
void SortFiles(vtkStringArray *input);
334 void AddSeriesFileNames(
335 int patient,
int study, vtkStringArray *files,
342 void AddSeriesWithQuery(
343 int patient,
int study, vtkStringArray *files,
366 int MatchesImageQuery(
370 void RelayError(
vtkObject *o,
unsigned long e,
void *data);
373 void SetInternalFileName(const
char *fname);
376 void SetErrorCode(
unsigned long e) VTK_DICOM_OVERRIDE {
377 this->ErrorCode = e; }
389 const char *dirname,
int depth, vtkStringArray *files);
399 #ifdef VTK_DICOM_DELETE
416 class SeriesInfoList;
417 class SeriesInfoVector;
422 SeriesVector *Series;
423 StudyVector *Studies;
424 PatientVector *Patients;
425 VisitedVector *Visited;
427 bool UsingOsirixDatabase;
435 static bool CompareInstance(
const FileInfo &fi1,
const FileInfo &fi2);
438 static bool CompareSeriesUIDs(
const SeriesInfo *si,
const char *uid);
441 static bool CompareSeriesIds(
const SeriesInfo *li1,
const SeriesInfo *li2);
444 static bool CompareSeriesInfo(
const SeriesInfo &li1,
const SeriesInfo &li2);
447 static bool CompareInstanceUIDs(
const FileInfoPair& p,
const char *uid);
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:54
Character sets.
Definition: vtkDICOMCharacterSet.h:55
Get information about all DICOM files within a directory.
Definition: vtkDICOMDirectory.h:47
void ProcessOsirixDatabase(const char *fname)
Process an OsiriX sqlite database file.
void Update(int) VTK_DICOM_OVERRIDE
void SetInputFileNames(vtkStringArray *sa)
Set a list of filenames (or files and directories) to read.
const vtkDICOMItem & GetPatientRecord(int patient)
Get the directory attributes for a patient.
void AddInputFileNames(vtkStringArray *sa)
Add more filenames to be read.
void SetQueryFilesToAlways()
Set when to query the files, rather than just the DICOMDIR index.
Definition: vtkDICOMDirectory.h:208
void Update() VTK_DICOM_OVERRIDE
Update the information about the files.
Definition: vtkDICOMDirectory.h:135
int GetNumberOfPatients()
Get the number of patients that were found.
vtkIntArray * GetStudiesForPatient(int patient)
Get the studies for this patient.
vtkDICOMMetaData * GetMetaDataForSeries(int i)
Get the meta data for a specific series.
int GetLastSeriesForStudy(int study)
Get the last series in a particular study.
int GetNumberOfStudies()
Get the number of studies that were found.
vtkTypeBool Update(vtkInformation *) VTK_DICOM_OVERRIDE
Definition: vtkDICOMDirectory.h:138
void SetFilePattern(const char *pattern)
Set a pattern to match for the filenames.
vtkStringArray * GetFileNamesForSeries(int i)
Get the file names for a specific series.
void ProcessDirectoryFile(const char *dirname, vtkDICOMMetaData *meta)
Add all of the series listed in a DICOMDIR file.
void SetFindLevel(int level)
Specify the find level.
const vtkDICOMItem & GetPatientRecordForStudy(int study)
Get the patient-related attributes for a specific study.
void PrintSelf(ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
void CopyRecord(vtkDICOMMetaData *meta, const vtkDICOMItem *item, int instance)
Copy attributes into a meta data object.
const vtkDICOMItem & GetStudyRecord(int study)
Get the directory attributes for a study.
const vtkDICOMItem & GetSeriesRecord(int series)
Get the directory attributes for a series.
void SetDefaultCharacterSet(vtkDICOMCharacterSet cs)
Set the character set to use if SpecificCharacterSet is missing.
vtkTypeBool Update(int i, vtkInformationVector *) VTK_DICOM_OVERRIDE
Definition: vtkDICOMDirectory.h:140
void SetDirectoryName(const char *name)
Set the input directory.
void ProcessDirectory(const char *dirname, int depth, vtkStringArray *files)
Process a directory, and subdirs to the specified depth.
An item in a DICOM sequence (type SQ).
Definition: vtkDICOMItem.h:34
A (group,element) identifier tag for DICOM attributes.
Definition: vtkDICOMTag.h:23
abstract base class for most VTK objects
Definition: vtkObject.h:54