Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLFileReader.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkMRMLFileReader_h
19#define __vtkMRMLFileReader_h
20
22
24
30class VTK_MRML_LOGIC_EXPORT vtkMRMLFileReader : public vtkMRMLFileIOHandler
31{
32public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
46 virtual double CanLoadFileConfidence(const std::string& filePath);
47
51 virtual bool CanLoadFile(const std::string& filePath);
52
57 std::vector<std::string> GetSupportedNameFilters(const std::string& filePath);
60 std::vector<std::string> GetSupportedNameFilters(const std::string& filePath, int& longestExtensionMatch);
61
65 virtual bool Load(vtkMRMLIOProperties* properties);
66
75 virtual std::string ExamineFileList(std::vector<std::string>& fileList, vtkMRMLIOProperties* ioProperties);
76
85 virtual double ExamineFileListConfidence(std::vector<std::string>& fileList, vtkMRMLIOProperties* ioProperties);
86
88 const std::vector<std::string>& GetLoadedNodeIDs() const;
89 void SetLoadedNodeIDs(const std::vector<std::string>& nodeIDs);
90 void AddLoadedNodeID(const std::string& nodeID);
92
95 vtkGetMacro(ConfidenceForMatchingExtension, double);
96 vtkSetMacro(ConfidenceForMatchingExtension, double);
97
98protected:
101
104 static std::string ReadFileHeader(const std::string& filePath, size_t maxLength);
105
107 static bool EndsWithNoCase(const std::string& text, const std::string& suffix);
108
110 std::vector<std::string> LoadedNodeIDs;
111
112private:
113 vtkMRMLFileReader(const vtkMRMLFileReader&) = delete;
114 void operator=(const vtkMRMLFileReader&) = delete;
115};
116
117#endif
static vtkMRMLFileReader * New()
~vtkMRMLFileReader() override
void AddLoadedNodeID(const std::string &nodeID)
static std::string ReadFileHeader(const std::string &filePath, size_t maxLength)
static bool EndsWithNoCase(const std::string &text, const std::string &suffix)
Returns true if the string ends with the suffix (case-insensitive).
void PrintSelf(ostream &os, vtkIndent indent) override
virtual double ExamineFileListConfidence(std::vector< std::string > &fileList, vtkMRMLIOProperties *ioProperties)
virtual std::string ExamineFileList(std::vector< std::string > &fileList, vtkMRMLIOProperties *ioProperties)
std::vector< std::string > GetSupportedNameFilters(const std::string &filePath, int &longestExtensionMatch)
virtual double CanLoadFileConfidence(const std::string &filePath)
virtual bool Load(vtkMRMLIOProperties *properties)
void SetLoadedNodeIDs(const std::vector< std::string > &nodeIDs)
void ClearLoadedNodeIDs()
const std::vector< std::string > & GetLoadedNodeIDs() const
The nodes the last Load added, by node ID.
virtual bool CanLoadFile(const std::string &filePath)
std::vector< std::string > LoadedNodeIDs
double ConfidenceForMatchingExtension
std::vector< std::string > GetSupportedNameFilters(const std::string &filePath)