[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. a87e1dd386c7c3bc16fac97c830e7e8c7d
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: malat <ma...@us...> - 2023-03-03 07:45:56
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via a87e1dd386c7c3bc16fac97c830e7e8c7d17df69 (commit)
via a44d5819afd6fdcf9fc2b22bb4d0b6df6da043ec (commit)
from efe56e99213ab3b6b8c36528bd3475151489152b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/a87e1dd386c7c3bc16fac97c830e7e8c7d17df69/
commit a87e1dd386c7c3bc16fac97c830e7e8c7d17df69
Author: Mad Vitaliy <ome...@gm...>
Date: Tue Feb 28 16:40:43 2023 +0200
empty line before EOF was added
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
index f85277f70..3eafa68be 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
@@ -43,4 +43,4 @@ int TestPreambleAssignmentOperator(int, char* [])
gdcm::Preamble p_2;
p_2 = p;
return 0;
-}
\ No newline at end of file
+}
https://sourceforge.net/p/gdcm/gdcm/ci/a44d5819afd6fdcf9fc2b22bb4d0b6df6da043ec/
commit a44d5819afd6fdcf9fc2b22bb4d0b6df6da043ec
Author: Mad Vitaliy <ome...@gm...>
Date: Tue Feb 28 16:38:04 2023 +0200
Preamble's copy constructor was fixed. FileMetaInformation was switched to use default copy constructor and assigment operator
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.h b/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.h
index 4209396a0..f5525b9da 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.h
+++ b/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.h
@@ -94,20 +94,9 @@ public:
static void SetSourceApplicationEntityTitle(const char * title);
static const char *GetSourceApplicationEntityTitle();
- FileMetaInformation(FileMetaInformation const &fmi):DataSet(fmi)
- {
- DataSetTS = fmi.DataSetTS;
- MetaInformationTS = fmi.MetaInformationTS;
- DataSetMS = fmi.DataSetMS;
- }
- FileMetaInformation& operator=(const FileMetaInformation& fmi)
- {
- DataSetTS = fmi.DataSetTS;
- MetaInformationTS = fmi.MetaInformationTS;
- DataSetMS = fmi.DataSetMS;
- return *this;
- }
-
+ FileMetaInformation(FileMetaInformation const& fmi) = default;
+ FileMetaInformation& operator=(const FileMetaInformation& fmi) = default;
+
VL GetFullLength() const {
return P.GetLength() + DataSet::GetLength<ExplicitDataElement>();
}
diff --git a/Source/DataStructureAndEncodingDefinition/gdcmPreamble.h b/Source/DataStructureAndEncodingDefinition/gdcmPreamble.h
index b4f0edcbf..b4a8fcd2e 100644
--- a/Source/DataStructureAndEncodingDefinition/gdcmPreamble.h
+++ b/Source/DataStructureAndEncodingDefinition/gdcmPreamble.h
@@ -57,12 +57,13 @@ public:
/// Return size of Preamble
VL GetLength() const { return 128 + 4; }
- Preamble(Preamble const &)
+ Preamble(Preamble const &):Internal(nullptr)
{
Create();
}
Preamble& operator=(Preamble const &)
{
+ Internal = nullptr;
Create();
return *this;
}
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestFileMetaInformation.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestFileMetaInformation.cxx
index 52207c0af..e3394ef26 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestFileMetaInformation.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestFileMetaInformation.cxx
@@ -45,3 +45,50 @@ int TestFileMetaInformation(int, char *[])
return 0;
}
+
+int TestFileMetaInformationCopyConstructor(int, char* [])
+{
+ std::string dataroot = gdcm::Testing::GetDataRoot();
+ std::string filename = dataroot + "/012345.002.050.dcm";
+
+ gdcm::Reader reader;
+ reader.SetFileName(filename.c_str());
+ if (!reader.Read())
+ {
+ std::cerr << "Failed to read: " << filename << std::endl;
+ return 1;
+ }
+
+ const gdcm::File& fi = reader.GetFile();
+ const gdcm::FileMetaInformation& hd = fi.GetHeader();
+ const gdcm::FileMetaInformation hd_of_copy(hd);
+
+ if (hd.IsEmpty()) return 1;
+ if (hd_of_copy.Size() != hd.Size()) return 1;
+ return 0;
+}
+
+int TestFileMetaInformationAssignmentOperator(int, char* [])
+{
+ std::string dataroot = gdcm::Testing::GetDataRoot();
+ std::string filename = dataroot + "/012345.002.050.dcm";
+
+ gdcm::Reader reader;
+ reader.SetFileName(filename.c_str());
+ if (!reader.Read())
+ {
+ std::cerr << "Failed to read: " << filename << std::endl;
+ return 1;
+ }
+
+ const gdcm::File& fi = reader.GetFile();
+ const gdcm::FileMetaInformation& hd = fi.GetHeader();
+
+ gdcm::File file_copy;
+ file_copy.SetHeader(hd); //Assignment Operator inside
+ gdcm::FileMetaInformation& hd_of_copy = file_copy.GetHeader();
+
+ if (hd.IsEmpty()) return 1;
+ if (hd_of_copy.Size() != hd.Size()) return 1;
+ return 0;
+}
diff --git a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
index d075ef229..f85277f70 100644
--- a/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
+++ b/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPreamble.cxx
@@ -29,3 +29,18 @@ int TestPreamble(int, char *[])
delete p;
return 0;
}
+
+int TestPreambleCopyConstructor(int, char *[])
+{
+ gdcm::Preamble p;
+ gdcm::Preamble p_2(p);
+ return 0;
+}
+
+int TestPreambleAssignmentOperator(int, char* [])
+{
+ gdcm::Preamble p;
+ gdcm::Preamble p_2;
+ p_2 = p;
+ return 0;
+}
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
.../gdcmFileMetaInformation.h | 17 ++------
.../gdcmPreamble.h | 3 +-
.../Cxx/TestFileMetaInformation.cxx | 47 ++++++++++++++++++++++
.../Cxx/TestPreamble.cxx | 15 +++++++
4 files changed, 67 insertions(+), 15 deletions(-)
hooks/post-receive
--
Grassroots DICOM
|