#include <Libs/MRML/Logic/vtkMRMLFileIOHandler.h>
|
| static std::vector< std::string > | ExtensionsFromNameFilter (const std::string &nameFilter) |
| | The extensions named by a filter such as "Mimics project (*.mcs *.mcs.gz)".
|
| |
| static std::vector< std::string > | GetMatchingNameFilters (const std::string &filePath, const std::vector< std::string > &nameFilters, bool requireReadableFile, int *longestExtensionMatch=nullptr) |
| |
| static int | IsTypeOf (const char *type) |
| |
| static std::string | LongestMatchingExtension (const std::string &filePath, const std::vector< std::string > &extensions) |
| |
| static std::vector< std::string > | NameFilterToWildcards (const std::string &nameFilter) |
| |
| static vtkMRMLFileIOHandler * | New () |
| |
| static vtkMRMLFileIOHandler * | SafeDownCast (vtkObject *o) |
| |
| static bool | WildcardMatch (const std::string &pattern, const std::string &text) |
| | Case-insensitive wildcard matching of the whole text. Supported wildcards: '*', '?', and character sets ("[abc]", "[!abc]").
|
| |
Base class of file readers and writers (vtkMRMLFileReader, vtkMRMLFileWriter). It stores the file type, description, and name filters of the reader or writer and describes its options.
See https://slicer.readthedocs.io/en/latest/developer_guide/mrml_overview.html#file-reading-and-writing
Definition at line 41 of file vtkMRMLFileIOHandler.h.
◆ Superclass
◆ vtkMRMLFileIOHandler()
| vtkMRMLFileIOHandler::vtkMRMLFileIOHandler |
( |
| ) |
|
|
protected |
◆ ~vtkMRMLFileIOHandler()
| vtkMRMLFileIOHandler::~vtkMRMLFileIOHandler |
( |
| ) |
|
|
overrideprotected |
◆ ExtensionsFromNameFilter()
| static std::vector< std::string > vtkMRMLFileIOHandler::ExtensionsFromNameFilter |
( |
const std::string & | nameFilter | ) |
|
|
static |
The extensions named by a filter such as "Mimics project (*.mcs *.mcs.gz)".
◆ FillOptionsDescription()
Fill the description of options for the specified context (properties may be nullptr). Sets properties and defaults in the description, then calls GetOptionsDescription().
◆ GetClassName()
| virtual const char * vtkMRMLFileIOHandler::GetClassName |
( |
| ) |
|
|
virtual |
Reimplemented in vtkMRMLFileReader, vtkMRMLFileWriter, vtkMRMLNodeWriter, vtkMRMLSceneBundleReader, vtkSlicerAnnotationsReader, vtkSlicerColorsReader, vtkSlicerMarkupsReader, vtkSlicerMarkupsWriter, vtkSlicerModelsReader, vtkSlicerSceneReader, vtkSlicerSceneWriter, vtkSlicerScriptedFileReaderBridge, vtkSlicerScriptedFileWriterBridge, vtkSlicerSegmentationsNodeWriter, vtkSlicerSegmentationsReader, vtkSlicerSequencesReader, vtkSlicerShaderPropertyReader, vtkSlicerTablesReader, vtkSlicerTerminologiesReader, vtkSlicerTextsReader, vtkSlicerTransformsReader, vtkSlicerVolumeRenderingReader, and vtkSlicerVolumesReader.
◆ GetDescription()
| virtual std::string vtkMRMLFileIOHandler::GetDescription |
( |
| ) |
|
|
virtual |
What to call this in a file dialog ("Volume", "Mimics project").
◆ GetExtensions()
| const std::vector< std::string > & vtkMRMLFileIOHandler::GetExtensions |
( |
| ) |
const |
|
inline |
The extensions of the name filters, lower case and with the dot: ".mcs", ".mcs.gz". A filter of "*.*" or "*" gives no extension: such a handler takes any file.
Definition at line 63 of file vtkMRMLFileIOHandler.h.
◆ GetFileIOManager()
The manager this handler is registered in (set by the manager), nullptr if it is not registered. It allows readers and writers to update application-wide IO settings, such as the default scene file type.
◆ GetFileType()
| virtual std::string vtkMRMLFileIOHandler::GetFileType |
( |
| ) |
|
|
virtual |
The kind of file this handles, as the rest of Slicer names it ("VolumeFile", "ModelFile", "SceneFile", or whatever a module calls its own).
◆ GetMatchedExtension()
| virtual std::string vtkMRMLFileIOHandler::GetMatchedExtension |
( |
const std::string & | filePath | ) |
const |
|
virtual |
The longest matching extension of filePath, or an empty string.
◆ GetMatchingNameFilters()
| static std::vector< std::string > vtkMRMLFileIOHandler::GetMatchingNameFilters |
( |
const std::string & | filePath, |
|
|
const std::vector< std::string > & | nameFilters, |
|
|
bool | requireReadableFile, |
|
|
int * | longestExtensionMatch = nullptr ) |
|
static |
Return the name filters that the file name matches. For example, if the file name is "my_image.nrrd" and the name filters are "Volumes (*.mha *.nrrd *.raw)", "Images (*.png *.jpg)", "DICOM (*)" then it returns "Volumes (*.mha *.nrrd *.raw)" and "DICOM (*)". If ␇ requireReadableFile is true then no filters are returned if the file is not a readable file (or it is a temporary file, with '~' in its extension).
- Parameters
-
| longestExtensionMatch | If non-zero then it is set to the length of the longest matched extension (not counting wildcard characters). It can be used to determine how specifically extension matched. |
◆ GetNameFilters()
| const std::vector< std::string > & vtkMRMLFileIOHandler::GetNameFilters |
( |
| ) |
const |
|
inline |
◆ GetOptionDefaults()
Default values of options that the application specifies (for example, from user settings). These values are used instead of the defaults of the reader or writer. Never null.
◆ GetOptionsDescription()
◆ GetOptionsDescriptionJSON()
| std::string vtkMRMLFileIOHandler::GetOptionsDescriptionJSON |
( |
vtkMRMLIOProperties * | properties | ) |
|
Get the description of options as JSON (see vtkMRMLIOOptionsDescription). Returns an empty string if the reader or writer has no options.
◆ GetOptionValues()
Get the values of all options for the specified context (default values, overridden by values in properties). It can be used for getting option values without displaying a user interface.
◆ GetScene()
◆ GetUserMessages()
Messages the user should see about the last read or write (a vtkMRMLMessageCollection, as the readers of Slicer use). Never null.
◆ IsA()
| virtual int vtkMRMLFileIOHandler::IsA |
( |
const char * | type | ) |
|
|
virtual |
Reimplemented in vtkMRMLFileReader, vtkMRMLFileWriter, vtkMRMLNodeWriter, vtkMRMLSceneBundleReader, vtkSlicerAnnotationsReader, vtkSlicerColorsReader, vtkSlicerMarkupsReader, vtkSlicerMarkupsWriter, vtkSlicerModelsReader, vtkSlicerSceneReader, vtkSlicerSceneWriter, vtkSlicerScriptedFileReaderBridge, vtkSlicerScriptedFileWriterBridge, vtkSlicerSegmentationsNodeWriter, vtkSlicerSegmentationsReader, vtkSlicerSequencesReader, vtkSlicerShaderPropertyReader, vtkSlicerTablesReader, vtkSlicerTerminologiesReader, vtkSlicerTextsReader, vtkSlicerTransformsReader, vtkSlicerVolumeRenderingReader, and vtkSlicerVolumesReader.
◆ IsTypeOf()
| static int vtkMRMLFileIOHandler::IsTypeOf |
( |
const char * | type | ) |
|
|
static |
◆ IsWriter()
| virtual bool vtkMRMLFileIOHandler::IsWriter |
( |
| ) |
const |
|
inlinevirtual |
◆ LongestMatchingExtension()
| static std::string vtkMRMLFileIOHandler::LongestMatchingExtension |
( |
const std::string & | filePath, |
|
|
const std::vector< std::string > & | extensions ) |
|
static |
The lower-case extension of a file name, taking the compound extensions of Slicer into account (".seg.nrrd" rather than ".nrrd"), against a list of known extensions.
◆ MatchesExtension()
| virtual bool vtkMRMLFileIOHandler::MatchesExtension |
( |
const std::string & | filePath | ) |
const |
|
virtual |
Whether the file name ends in one of the extensions. A handler with no extension of its own matches nothing here; it has to say what it can do in CanLoadFileConfidence instead.
◆ NameFilterToWildcards()
| static std::vector< std::string > vtkMRMLFileIOHandler::NameFilterToWildcards |
( |
const std::string & | nameFilter | ) |
|
|
static |
Get the list of wildcard patterns from a name filter. For example: "Image (*.jpg *.png)" -> "*.jpg", "*.png". A name filter without brackets is returned as is if it is a valid wildcard ("*.jpg").
◆ New()
◆ PrintSelf()
| void vtkMRMLFileIOHandler::PrintSelf |
( |
ostream & | os, |
|
|
vtkIndent | indent ) |
|
override |
◆ SafeDownCast()
◆ SetDescription()
| virtual void vtkMRMLFileIOHandler::SetDescription |
( |
std::string | | ) |
|
|
virtual |
◆ SetFileIOManager()
◆ SetFileType()
| virtual void vtkMRMLFileIOHandler::SetFileType |
( |
std::string | | ) |
|
|
virtual |
◆ SetNameFilters()
| void vtkMRMLFileIOHandler::SetNameFilters |
( |
const std::vector< std::string > & | filters | ) |
|
The name filters, as Slicer writes them: "Mimics project (*.mcs *.mcs.gz)".
◆ SetScene()
| virtual void vtkMRMLFileIOHandler::SetScene |
( |
vtkMRMLScene * | scene | ) |
|
|
virtual |
Where the nodes go, and where messages for the user are collected.
◆ WildcardMatch()
| static bool vtkMRMLFileIOHandler::WildcardMatch |
( |
const std::string & | pattern, |
|
|
const std::string & | text ) |
|
static |
Case-insensitive wildcard matching of the whole text. Supported wildcards: '*', '?', and character sets ("[abc]", "[!abc]").
◆ Description
| std::string vtkMRMLFileIOHandler::Description |
|
protected |
◆ Extensions
| std::vector<std::string> vtkMRMLFileIOHandler::Extensions |
|
protected |
◆ FileIOManager
◆ FileType
| std::string vtkMRMLFileIOHandler::FileType |
|
protected |
◆ NameFilters
| std::vector<std::string> vtkMRMLFileIOHandler::NameFilters |
|
protected |
◆ OptionDefaults
◆ Scene
◆ UserMessages
The documentation for this class was generated from the following file: