Skip to content
Snippets Groups Projects
Commit 61d343e2 authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot
Browse files

Merge topic 'dicom-close-file'


3c9d9626 Close the DICOM file immediately after reading it.

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !339
parents 7fd96d96 3c9d9626
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,7 @@ void vtkDICOMImageReader::ExecuteInformation()
this->AppHelper->RegisterCallbacks(this->Parser);
this->Parser->ReadHeader();
this->Parser->CloseFile();
vtkDebugMacro( << "File name : " << fn );
vtkDebugMacro( << "Slice number : " << this->AppHelper->GetSliceNumber());
......
......@@ -95,11 +95,8 @@ DICOMParser::GetFileName()
bool DICOMParser::OpenFile(const dicom_stl::string& filename)
{
if (this->DataFile)
{
// Deleting the DataFile closes the file
delete this->DataFile;
}
// Deleting the DataFile closes any previously opened file
delete this->DataFile;
this->DataFile = new DICOMFile();
bool val = this->DataFile->Open(filename);
......@@ -126,6 +123,13 @@ bool DICOMParser::OpenFile(const dicom_stl::string& filename)
return val;
}
void DICOMParser::CloseFile()
{
// Deleting the DataFile closes any previously opened file
delete this->DataFile;
this->DataFile = 0;
}
DICOMParser::~DICOMParser() {
//
// Delete the callbacks.
......
......@@ -71,6 +71,11 @@ class DICOM_EXPORT DICOMParser
//
bool OpenFile(const dicom_stl::string& filename);
//
// Closes the currently open file.
//
void CloseFile();
//
// Return the name of the file last processed.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment