FLImaging 6.5.16.1
TensorLabelsIsotropicRatio.h
1#pragma once
2
3#if _MSC_VER >= 1900 && defined(_M_X64)
4
5#include "TensorLabels.h"
6
7#include <atomic>
8
9namespace FLImaging
10{
11 namespace AI
12 {
13 class FL_EXPORT CValidationImageExtractorDL;
14
15 template <typename T>
16 class FL_EXPORT CTensorLabelsIsotropicRatio : public CTensorLabels<T>
17 {
18 public:
19 CTensorLabelsIsotropicRatio();
20
21 CTensorLabelsIsotropicRatio(const CTensorLabelsIsotropicRatio<T>& tsr, bool bDeepCopy = true);
22
23 virtual ~CTensorLabelsIsotropicRatio();
24
25 virtual const CResult GetBinaryData(Base::CFLData& fldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
26 virtual const CResult GetBinaryData(Base::CFLData* pFldBinary, bool bSuperClass = false, int32_t i32Version = -1, bool bDumpMode = false) const override;
27
28 virtual const CResult SetBinaryData(const Base::CFLData& fldBinary, int64_t* pI64Offset = nullptr) override;
29 virtual const CResult SetBinaryData(const Base::CFLData* pFldBinary, int64_t* pI64Offset = nullptr) override;
30
31 virtual const CResult Create(const Base::CFLImage& fli, bool bNormalize = true, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex = nullptr, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool *pBAbort = nullptr);
32 virtual const CResult Create(const Base::CFLImage* pFli, bool bNormalize = true, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex = nullptr, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool *pBAbort = nullptr);
33 virtual const CResult Create(const Base::CFLImage& fli, const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod, bool bROIExtraction, bool bNormalize, const Base::CMultiVar<T>& mvBlankColor, ImageProcessing::EInterpolationMethod eInterpolationMethod, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex, bool* pBAbort) override;
34 virtual const CResult Create(const Base::CFLImage* pFli, const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod, bool bROIExtraction, bool bNormalize, const Base::CMultiVar<T>& mvBlankColor, ImageProcessing::EInterpolationMethod eInterpolationMethod, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex, bool* pBAbort) override;
35 virtual const CResult Create(const Base::CFLImage& fli, const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises, bool bROIExtraction = false, bool bNormalize = true, const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex = nullptr, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool *pBAbort = nullptr);
36 virtual const CResult Create(const Base::CFLImage* pFli, const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises, bool bROIExtraction = false, bool bNormalize = true, const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex = nullptr, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool *pBAbort = nullptr);
37
38 virtual const CResult Create(const wchar_t* pWcFilePath, const std::vector<int64_t>& vctNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises, bool bROIExtraction = false, bool bNormalize = true, const Base::CMultiVar<T>& mvBlankColor = 0., bool bRecursive = false, ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear);
39 virtual const CResult Create(const wchar_t* pWcFilePath, const std::initializer_list<int64_t>& ilNewSize, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises, bool bROIExtraction = false, bool bNormalize = true, const Base::CMultiVar<T>& mvBlankColor = 0., bool bRecursive = false, ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear);
40
41 virtual const CResult Assign(const CTensor<T>* pTsr, bool bDeepCopy = true) override;
42
43 virtual const CResult Assign(const CTensorLabelsIsotropicRatio<T>& tsr, bool bDeepCopy = true);
44 virtual const CResult Assign(const CTensorLabelsIsotropicRatio<T>* pTsr, bool bDeepCopy = true);
45
46 virtual const CResult Append(const Base::CFLImage* pFli, EResizeMethod eResizeMethod = EResizeMethod_ScaleAllAxises, bool bROIExtraction = false, bool bNormalize = true, const Base::CMultiVar<T>& mvBlankColor = 0., ImageProcessing::EInterpolationMethod eInterpolationMethod = ImageProcessing::EInterpolationMethod_Bilinear, std::atomic<int32_t>* pI32CurrentPreparingTensorIndex = nullptr, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool *pBAbort = nullptr);
47 virtual const CResult Append(const wchar_t* pWcFilePath, bool bRecursive = false) override;
48
49 virtual const CResult Initialize() override;
50 virtual const CResult Clear() override;
51
52 virtual const CResult SetBatchParameters(const CTensorImages<T>& tsr) override;
53 virtual const CResult SetBatchParameters(const CTensorLabelsIsotropicRatio<T>& tsr);
54
55 virtual const CResult SetAlignMode(EAlignMode eAlignMode = EAlignMode_Left);
56 virtual EAlignMode GetAlignMode();
57
58 virtual const CResult EnableAngleReflection(bool bAngleReflection = false);
59 virtual bool IsAngleReflectionEnable();
60
61 virtual const CResult EnableHorizental(bool bHorizental = true);
62 virtual bool IsHorizentalEnable();
63
64 virtual CTensorLabelsIsotropicRatio<T>& Evaluate() override;
65
66 virtual CComputationalBase<T>* Clone() const override;
67 virtual const CResult Swap(CComputationalBase<T>& cbSwap) override;
68
69 virtual const CResult LoadTensor(const std::vector<int64_t>& vctBatchIndices) override;
70
71
72 DeclareGetClassType();
73 SupportToDuplicateObject(CTensorLabelsIsotropicRatio, *this);
74 protected:
75 virtual const CResult DecodeLabels(const wchar_t* pWcsImagePath, Base::CFLImage* pFli = nullptr) override;
76 virtual const CResult AddLabel(const wchar_t* pWcsName, Foundation::CFLFigure* pFlfLabel, bool bFile = false);
77
78 virtual const CResult CropImage(const Base::CFLImage* pFliSrc, Base::CFLImage* pFliDst, int64_t i64Width, int64_t i64Height, const Base::CMultiVar<T>& mvBlankColor, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool* pBAbort = nullptr);
79 virtual const CResult CropImage(const std::vector<int64_t>& vctBatchIndices, const Base::CFLImage* pFliSrc, Base::CFLImage* pFliDst, int64_t i64Width, int64_t i64Height, const Base::CMultiVar<T>& mvBlankColor, std::atomic<int32_t>* pI32CurrentPreparingLabelIndex = nullptr, bool* pBAbort = nullptr);
80 virtual const CResult CropImageUnit(const Base::CFLImage* pFliSrc, Base::CFLImage* pFliDst, int32_t i32FigureNum, int64_t i64Width, int64_t i64Height);
81 virtual const CResult CropImageUnit(const Base::CFLImage* pFliSrc, Base::CFLImagePage* pFliDstPage, int32_t i32FigureNum, int64_t i64Width, int64_t i64Height);
82
83 protected:
84
85 std::vector<std::pair<int32_t, int32_t>>& m_vctPageFigureNum;
86
87 EAlignMode m_eAlignMode;
88 bool m_bAngleReflection;
89 bool m_bHorizontal;
90 bool m_bSequenceLabel;
91
92 private:
93 friend class CValidationImageExtractorDL;
94 public:
95 DeclareGetSignletonObject(CTensorLabelsIsotropicRatio);
96 };
97
98 #define CCGFTensorLabelsIsotropicRatio(...) (*(new CTensorLabelsIsotropicRatio<float>(__VA_ARGS__)))
99 #define CCGDTensorLabelsIsotropicRatio(...) (*(new CTensorLabelsIsotropicRatio<double>(__VA_ARGS__)))
100
101 typedef CTensorLabelsIsotropicRatio<float> CTensorLabelsIsotropicRatioF;
102 typedef CTensorLabelsIsotropicRatio<double> CTensorLabelsIsotropicRatioD;
103 }
104}
105
106#endif
@ Assign
Set the value of CGUIPropertyItemView3DFigure to the specified figure.
@ Clear
Clear all the figure objects.