#include <ImFusion/Base/SharedImageSet.h>
#include <ImFusion/Dicom/DicomElement.h>
#include <ImFusion/Dicom/DicomIOD.h>
#include <ImFusion/Dicom/Extension.h>
#include <dcmtk/dcmdata/dctk.h>
{
public:
std::string name()
const override {
return "Extension Example2"; }
{
{
bool hasShared = false;
if (enhanced->sharedSequence.count() >= 1)
{
auto& shared = enhanced->sharedSequence.item(0);
Windowing windowing(shared.dataset());
if (windowing.exists())
{
windowing.load(sis);
hasShared = true;
}
}
if (!hasShared && frame.
index < enhanced->perFrameSequence.count())
{
auto& perFrame = enhanced->perFrameSequence.item(frame.
index);
Windowing windowing(perFrame.dataset());
if (windowing.exists())
windowing.load(sis);
}
}
else
{
if (windowing.exists())
windowing.load(sis);
}
return {};
}
private:
class Windowing
{
public:
Windowing(DcmItem& parent)
{
}
bool exists() {
return center.
exists() && width.exists(); }
{
}
};
};
@ Conditional
Element is optional. If a condition is met (see setCondition), it has to satisfy that.
Definition DicomElement.h:80
virtual bool exists() const
Returns true if the elements exists in the dataset.
Dicom Element with a concrete value type.
Definition VolumeReconstruction.h:20
Class representing Enhanced CT Image IOD (PS 3.3 A.38)
Definition DicomIOD.h:292
Interface for adding custom functionality to DicomLoader and DicomWriter An Extension might be called...
Definition Extension.h:26
DcmDataset & dataset() override
Returns the dataset represented by this IOD.
Set of images independent of their storage location.
Definition SharedImageSet.h:42
Namespace of the ImFusion SDK.
Definition Assert.h:7
Descriptor for a single DICOM frame that is used during the loading process as intermediate represent...
Definition DicomIOD.h:33
IOD * iod
Parent IOD that loaded the frame. Never nullptr and must not be re-assigned.
Definition DicomIOD.h:52
int index
Index of the frame in the iod.
Definition DicomIOD.h:53