FAST
3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
|
Go to the documentation of this file.
27 std::vector<std::shared_ptr<Image>>
getImages()
const {
29 throw Exception(
"The inference that list contains tensors, not images");
33 std::vector<std::shared_ptr<Tensor>>
getTensors()
const {
35 throw Exception(
"The inference that list contains images, not tensors");
39 bool isTensors()
const {
return !m_tensors.empty(); };
40 bool isImages()
const {
return !m_images.empty(); };
42 return isImages() ? m_images.size() : m_tensors.size();
45 std::vector<std::shared_ptr<Image>> m_images;
46 std::vector<std::shared_ptr<Tensor>> m_tensors;
52 void create(std::vector<std::shared_ptr<Image>> images) {
55 void create(std::vector<std::shared_ptr<Tensor>> tensors) {
66 void create(std::vector<std::shared_ptr<Image>> images) {
69 void create(std::vector<std::shared_ptr<Tensor>> tensors) {
84 void load(std::string filename);
90 void load(std::vector<uint8_t> model, std::vector<uint8_t> weights);
100 void setInferenceEngine(std::string engine);
112 void setScaleFactor(
float scale);
118 void setMeanAndStandardDeviation(
float mean,
float std);
124 void setMinAndMaxIntensity(
float min,
float max);
125 void setSignedInputNormalization(
bool signedInputNormalization);
126 void setPreserveAspectRatio(
bool preserve);
132 void setHorizontalFlipping(
bool flip);
142 void setTemporalWindow(
uint window);
144 virtual void setInputSize(std::string name, std::vector<int> size);
146 void loadAttributes();
152 bool mHorizontalImageFlipping =
false;
153 bool mSignedInputNormalization =
false;
154 int mTemporalWindow = 0;
156 float mScaleFactor, mMean,
mStd, mMinIntensity, mMaxIntensity;
157 bool mMinAndMaxIntensitySet =
false;
166 std::unordered_map<std::string, std::vector<std::shared_ptr<Image>>>
mInputImages;
167 std::unordered_map<std::string, std::vector<std::shared_ptr<Tensor>>>
mInputTensors;
169 std::unordered_map<std::string, Tensor::pointer> processInputData();
170 std::vector<std::shared_ptr<Image>> resizeImages(
const std::vector<std::shared_ptr<Image>>& images,
int width,
int height,
int depth);
NodeType
Definition: InferenceEngine.hpp:26
DataAccess< InferenceDataList >::pointer access
Definition: NeuralNetwork.hpp:57
Definition: NeuralNetwork.hpp:49
std::shared_ptr< InferenceEngine > pointer
Definition: InferenceEngine.hpp:78
bool mPreserveAspectRatio
Definition: NeuralNetwork.hpp:151
Vector3f mNewInputSpacing
Definition: NeuralNetwork.hpp:158
std::unordered_map< int, DataObject::pointer > m_processedOutputData
Definition: NeuralNetwork.hpp:160
Definition: Exception.hpp:15
Definition: TensorShape.hpp:9
Definition: SimpleDataObject.hpp:24
Definition: AffineTransformation.hpp:7
std::shared_ptr< InferenceEngine > m_engine
Definition: NeuralNetwork.hpp:164
std::vector< std::shared_ptr< Image > > getImages() const
Definition: NeuralNetwork.hpp:27
Definition: NeuralNetwork.hpp:16
std::unique_ptr< DataAccess< DataType > > pointer
Definition: SimpleDataObject.hpp:36
InferenceDataList(std::vector< std::shared_ptr< Image >> images)
Definition: NeuralNetwork.hpp:18
int getSize() const
Definition: NeuralNetwork.hpp:41
#define FAST_OBJECT(className)
Definition: Object.hpp:9
int m_batchSize
Definition: NeuralNetwork.hpp:155
bool isImages() const
Definition: NeuralNetwork.hpp:40
DataAccess< InferenceDataList >::pointer access
Definition: NeuralNetwork.hpp:71
std::unordered_map< std::string, std::vector< std::shared_ptr< Image > > > mInputImages
Definition: NeuralNetwork.hpp:166
InferenceDataList(std::vector< std::shared_ptr< Tensor >> tensors)
Definition: NeuralNetwork.hpp:21
T max(T a, T b)
Definition: Utility.hpp:46
std::unordered_map< std::string, std::vector< int > > mInputSizes
Definition: NeuralNetwork.hpp:159
void create(std::vector< std::shared_ptr< Tensor >> tensors)
Definition: NeuralNetwork.hpp:55
InferenceDataList()
Definition: NeuralNetwork.hpp:24
std::vector< std::shared_ptr< Tensor > > getTensors() const
Definition: NeuralNetwork.hpp:33
T min(T a, T b)
Definition: Utility.hpp:41
std::shared_ptr< DataObject > pointer
Definition: DataObject.hpp:16
void create(std::vector< std::shared_ptr< Image >> images)
Definition: NeuralNetwork.hpp:52
float mStd
Definition: NeuralNetwork.hpp:156
Definition: NeuralNetwork.hpp:63
void create(std::vector< std::shared_ptr< Tensor >> tensors)
Definition: NeuralNetwork.hpp:69
unsigned int uint
Definition: DataTypes.hpp:16
Definition: NeuralNetwork.hpp:77
InferenceDataList mData
Definition: SimpleDataObject.hpp:83
void create(std::vector< std::shared_ptr< Image >> images)
Definition: NeuralNetwork.hpp:66
std::unordered_map< std::string, std::vector< std::shared_ptr< Tensor > > > mInputTensors
Definition: NeuralNetwork.hpp:167
Definition: ProcessObject.hpp:22
bool isTensors() const
Definition: NeuralNetwork.hpp:39