FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
TensorShape.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <FAST/Object.hpp>
6 
7 namespace fast {
8 
9 class FAST_EXPORT TensorShape {
10  public:
15  TensorShape(std::initializer_list<int> dimensions);
20  TensorShape(VectorXi dimensions);
25  explicit TensorShape(std::vector<int> dimensions);
30  TensorShape(const TensorShape& other);
36  TensorShape& operator=(const TensorShape& other);
40  TensorShape();
44  bool empty() const;
49  int getTotalSize() const;
54  int getDimensions() const;
59  int getKnownDimensions() const;
63  int getUnknownDimensions() const;
68  std::vector<int> getAll() const;
69  int& operator[](int i);
70  const int& operator[](int i) const;
76  void setDimension(int i, int value);
81  void addDimension(int value);
87  void insertDimension(int position, int value);
91  std::string toString() const;
92 
97  void deleteDimension(int index);
98 
104  void deleteDimensions(int startIndex, int endIndex);
105  private:
106  std::vector<int> m_data;
107 };
108 
109 }
Object.hpp
fast::TensorShape
Definition: TensorShape.hpp:9
fast
Definition: AffineTransformation.hpp:7
DataTypes.hpp