GDCM: gdcmCleaner.h Source File

GDCM 3.2.8

gdcmCleaner.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMCLEANER_H
15#define GDCMCLEANER_H
16
17#include "gdcmDPath.h"
18#include "gdcmFile.h"
19#include "gdcmSmartPointer.h"
20#include "gdcmSubject.h"
21
22namespace gdcm {
30 class GDCM_EXPORT Cleaner : public Subject {
31 public:
32 Cleaner();
33 ~Cleaner() override;
34
36 bool Empty(Tag const &t);
37 bool Empty(PrivateTag const &pt);
38 bool Empty(DPath const &dpath);
39 bool Empty(VR const &vr);
40
41 bool Remove(Tag const &t);
42 bool Remove(PrivateTag const &pt);
43 bool Remove(DPath const &dpath);
44 bool Remove(VR const &vr);
45
47 bool Scrub(Tag const &t);
48 bool Scrub(PrivateTag const &pt);
49 bool Scrub(DPath const &dpath);
50 bool Scrub(VR const &vr);
51
52 // 8 Encoding of Coded Entry Data
53 // https://dicom.nema.org/medical/dicom/current/output/chtml/part03/chapter_8.html
54 typedef std::tuple<std::string, std::string, std::string> CodedEntryData;
55
57 bool ReplaceCodeMeaning(CodedEntryData const &ced);
58
60 bool Preserve(DPath const &dpath);
61
64 void RemoveAllMissingPrivateCreator(bool remove);
65
68 bool RemoveMissingPrivateCreator(Tag const &t);
69
71 void RemoveAllGroupLength(bool remove);
72
74 void RemoveAllIllegal(bool remove);
75
77 void EmptyWhenScrubFails(bool empty);
78
80 bool Clean();
81
83 void SetFile(const File &f) { F = f; }
84 // const File &GetFile() const { return *F; }
85 File &GetFile() { return *F; }
86
88 static SmartPointer<Cleaner> New() { return new Cleaner; }
89
90 private:
91 // I would prefer to have a smart pointer to DataSet but DataSet does not
92 // derive from Object...
93 SmartPointer<File> F;
94 struct impl;
95 // PIMPL idiom
96 impl *pimpl;
97};
98
99} // end namespace gdcm
100
101#endif // GDCMCLEANER_H
gdcm::Cleaner::Cleaner
Cleaner()
gdcm::Cleaner::RemoveAllMissingPrivateCreator
void RemoveAllMissingPrivateCreator(bool remove)
gdcm::Cleaner::CodedEntryData
std::tuple< std::string, std::string, std::string > CodedEntryData
Definition gdcmCleaner.h:54
gdcm::Cleaner::Scrub
bool Scrub(DPath const &dpath)
gdcm::Cleaner::Empty
bool Empty(DPath const &dpath)
gdcm::Cleaner::ReplaceCodeMeaning
bool ReplaceCodeMeaning(CodedEntryData const &ced)
Coded Entry Data.
gdcm::Cleaner::New
static SmartPointer< Cleaner > New()
for wrapped language: instantiate a reference counted object
Definition gdcmCleaner.h:88
gdcm::Cleaner::Remove
bool Remove(PrivateTag const &pt)
gdcm::Cleaner::Scrub
bool Scrub(PrivateTag const &pt)
gdcm::Cleaner::Clean
bool Clean()
main loop
gdcm::Cleaner::Scrub
bool Scrub(VR const &vr)
gdcm::Cleaner::Scrub
bool Scrub(Tag const &t)
Clean digital tash (typically SIEMENS CSA header):
gdcm::Cleaner::SetFile
void SetFile(const File &f)
Set/Get File.
Definition gdcmCleaner.h:83
gdcm::Cleaner::EmptyWhenScrubFails
void EmptyWhenScrubFails(bool empty)
Should I empty instead of scrub upon failure.
gdcm::Cleaner::RemoveMissingPrivateCreator
bool RemoveMissingPrivateCreator(Tag const &t)
gdcm::Cleaner::~Cleaner
~Cleaner() override
gdcm::Cleaner::Empty
bool Empty(VR const &vr)
gdcm::Cleaner::RemoveAllGroupLength
void RemoveAllGroupLength(bool remove)
Should I remove all group length (deprecated). Default: true.
gdcm::Cleaner::Preserve
bool Preserve(DPath const &dpath)
Preserve.
gdcm::Cleaner::Remove
bool Remove(DPath const &dpath)
gdcm::Cleaner::Empty
bool Empty(PrivateTag const &pt)
gdcm::Cleaner::Remove
bool Remove(VR const &vr)
gdcm::Cleaner::RemoveAllIllegal
void RemoveAllIllegal(bool remove)
Should I remove all illegal attribute. Default: true.
gdcm::Cleaner::GetFile
File & GetFile()
Definition gdcmCleaner.h:85
gdcm::Cleaner::Empty
bool Empty(Tag const &t)
gdcm::Cleaner::Remove
bool Remove(Tag const &t)
gdcm::DPath
class to handle a DICOM path While supp 118 did introduced a notion of XPath for XML Native model thi...
Definition gdcmDPath.h:28
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::PrivateTag
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner).
Definition gdcmPrivateTag.h:39
gdcm::SmartPointer
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
gdcm::Subject::Subject
Subject()
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcm::VR
VR class.
Definition gdcmVR.h:55
gdcmDPath.h
gdcmFile.h
gdcmSmartPointer.h
gdcmSubject.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21