MeVisLab Toolbox Reference
mlMultiFileVolumeListImageOutput.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
6
12
13//----------------------------------------------------------------------------------
14#pragma once
15
17
18// Overlay handling stuff.
19#include <mlDicomToMLTools.h>
20
22
23// Forward to internally used classes.
24class MultiFileVolume;
25
26//----------------------------------------------------------------------------------
29//----------------------------------------------------------------------------------
31{
32public:
33
43 int numOutputs=2,
48
50
51public:
52
57
58protected:
59
62
66
72 void calculateOutputSubImage (SubImage *outSubImg, int outIndex, SubImage *inSubImgs) override;
73
79
80protected:
84 IntField *extFld[6] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
85
87 IntField *numVolVoxelsFld = nullptr;
88
90 StringField *dataTypeFld = nullptr;
91
93 DoubleField *minVoxelValueFld = nullptr;
94
96 DoubleField *maxVoxelValueFld = nullptr;
97
100 void addFields(Module &mod, const std::string suffix = "")
101 {
102 extFld[0] = mod.addInt( (std::string("extX" )+suffix).c_str(), 0);
103 extFld[1] = mod.addInt( (std::string("extY" )+suffix).c_str(), 0);
104 extFld[2] = mod.addInt( (std::string("extZ" )+suffix).c_str(), 0);
105 extFld[3] = mod.addInt( (std::string("extC" )+suffix).c_str(), 0);
106 extFld[4] = mod.addInt( (std::string("extT" )+suffix).c_str(), 0);
107 extFld[5] = mod.addInt( (std::string("extU" )+suffix).c_str(), 0);
108 numVolVoxelsFld = mod.addInt( (std::string("numVolVoxels")+suffix).c_str(), 0);
109 dataTypeFld = mod.addString((std::string("dataType" )+suffix).c_str(), "");
110 minVoxelValueFld = mod.addDouble((std::string("minVoxVal" )+suffix).c_str(), 0);
111 maxVoxelValueFld = mod.addDouble((std::string("maxVoxVal" )+suffix).c_str(), 0);
112 }
115 {
116 // Extract data from volume.
117 ImageVector ext(0);
118 std::string dtString;
121
122 if (pagedImage){
123 // Get image information if there is any.
124 ext = pagedImage->getImageExtent();
125 dtString = MLDataTypeNames()[pagedImage->getDataType()];
126 minVoxVal = pagedImage->getMinVoxelValue();
127 maxVoxVal = pagedImage->getMaxVoxelValue();
128 }
129
130 // Update fields to information about current volume.
131 extFld[0] ->setIntValue(ext.x);
132 extFld[1] ->setIntValue(ext.y);
133 extFld[2] ->setIntValue(ext.z);
134 extFld[3] ->setIntValue(ext.c);
135 extFld[4] ->setIntValue(ext.t);
136 extFld[5] ->setIntValue(ext.u);
137 numVolVoxelsFld ->setIntValue(ext.compMul());
138 dataTypeFld ->setStringValue(dtString);
139 minVoxelValueFld ->setDoubleValue(minVoxVal);
140 maxVoxelValueFld ->setDoubleValue(maxVoxVal);
141 }
142 };
143
144private:
145
147 void _initializeFieldsAndMembers();
148
151
153 OutputImageProperties _imageOutput0Properties;
154
157 NotifyField *_updateImageOutputInformationDoneFld;
159
162
165
166};
167
#define MLDIRECTDICOMIMPORTOUTPUTS_EXPORT
DLL export macro definition.
Field to encapsulate a double value.
Definition mlFields.h:538
void setDoubleValue(double doubleValue)
Set field value to doubleValue. By default the entire double type range can be set.
IntField * addInt(const char *name)
Creates an IntField with name and adds it to the container. Default value is 0.
DoubleField * addDouble(const char *name)
Creates a DoubleField with name and adds it to the container. Default value is 0.
StringField * addString(const char *name)
Creates a StringField with name and adds it to the container. Default value is empty string.
Field to encapsulate an integer value.
Definition mlFields.h:126
void setIntValue(MLint intValue)
Sets field value to intValue.
Base class for an image processing module of the ML.
Definition mlModule.h:151
The ML module base class MultiFileVolumeListBaseOutput used to implement further output modules for t...
The ML module class MultiFileVolumeListImageOutput for extending the number of image outputs of Multi...
void calculateOutputImageProperties(int outIndex, PagedImage *outImg) override
Sets properties of the output image at output outIndex.
void updateToVolume(MultiFileVolume *outVolToUse) override
Updates image outputs and internal pointer to the passed MultiFileVolume.
void calculateOutputSubImage(SubImage *outSubImg, int outIndex, SubImage *inSubImgs) override
Calculates page outSubImg of output image with index outIndex by using inSubimgs.
virtual void fillOutSubImageFromMultiFileVolume(SubImage outSubImg)
Fill outSubImg with data from MultiFileVolumeListBaseOutput::getCurrentlySetVolume() which is expecte...
MultiFileVolumeListImageOutput(int numInputs=0, int numOutputs=2, bool autoInstallTagDumpFieldAddOn=true, bool installInputAccessConnector=true, bool installInputMessageFilterPlugin=true, bool installOutputAccessConnector=true)
Constructor.
void _updateVolumeInformation(MultiFileVolume *currVol) override
This is called by the super class if the volume has changed.
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Field without value for notifications.
Definition mlFields.h:659
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a string value.
Definition mlFields.h:610
void setStringValue(const std::string &stringValue) override
Sets value of the field to stringValue.
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition mlSubImage.h:75
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
MLEXPORT const char *const * MLDataTypeNames()
Function which returns the table of c-strings of all scalar and registered data types.
Tool class with many tool functions for the conversion of DICOM information and tag values to compara...
Provides the base class for an additional output for a MultiFileVolumeList module.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
double MLdouble
Definition mlTypeDefs.h:217
std::vector< FrameSpecificTags > FrameSpecificTagsVector
Often used std::vector type of FrameSpecificTag elements.
Helper container to manage fields related to an image output.
void readAndSetFromPagedImage(const PagedImage *pagedImage)
Reads field contents from pagedImage if that one is not nullptr, otherwise the field values are reset...
void addFields(Module &mod, const std::string suffix="")
Create fields and add their pointers for field container of mod; suffix is appended to all field name...