![]() |
ImFusion C++ SDK 4.4.0
|
Classes | |
| struct | Settings |
| struct | SettingsUpdate |
| class | TypeSpecificData |
| struct | PixelwiseLabelType |
| struct | GeometricAnnotationType |
| struct | Permissions |
| Permissions a user has regarding a project. More... | |
| struct | ImportResult |
| struct | ProjectImportResult |
Public Types | |
| enum | ProjectType { NoProjectType = 0 , PixelwiseProject = 1 << 0 , ImagewiseProject = 1 << 1 , GeometricAnnotationsProject = 1 << 4 } |
| enum class | DataType { InvalidDataType = 0 , SingleChannelImages = 1 << 0 , MultiChannelImages = 1 << 1 , SingleChannelVolumes = 1 << 2 , MultiChannelVolumes = 1 << 3 , AnyDataType = SingleChannelImages | MultiChannelImages | SingleChannelVolumes | MultiChannelVolumes } |
| enum | Version { V0 = 0 , V1 , V2 , V3 , V4 , V5 , V6 , V7 , V8 , V9 , V10 , V11 , V12 , V13 , V14 , V15 , V16 , V17 , V18 , V19 , V20 , V21 , VERSION_COUNT } |
| enum class | LayersToModify { All , CurrentOnly } |
| enum | ImportProjectOption { ImportNewOnes = 1 << 0 , ForceCopy = 1 << 1 , UpdateExisting = 1 << 2 , CopyLabelData = 1 << 3 , CopyTags = 1 << 4 } |
| enum | LoadStatus { OK = 0 , INTERRUPTED , NOT_FOUND , NOT_COMPATIBLE } |
| enum class | FailureAction { Discard , Retry , Export } |
| using | ProjectTypes = Flags<ProjectType> |
| using | DataTypes = Flags<DataType> |
| using | PixelwiseData = TypeSpecificData<PixelwiseLabelType> |
| using | GeometricAnnotationData = TypeSpecificData<GeometricAnnotationType> |
| using | TypeMapping = std::vector<std::optional<size_t>> |
| using | WarningMessage = std::string |
| using | FailureActionAndPath = std::tuple<FailureAction, std::string> |
| The additional path to a folder is only used together with Export. | |
Public Member Functions | |
| Project (const Project &)=delete | |
| Project & | operator= (const Project &)=delete |
| Utils::Expected< std::pair< std::unique_ptr< Project >, WarningMessage >, std::string > | copyToRemote (const Filesystem::Url &remoteUrl, const std::set< QString > &descriptorIdsToCopy={}, Progress *progress=nullptr) const |
| Copies the current local project to the remote server \remoteUrl URL of the remote labels server \descriptorIdsToCopy set of descriptor ids to copy (default empty - all descriptors are copied). | |
| std::string | addDescriptor (std::unique_ptr< DataDescriptor > desc, const SharedImageSet *image=nullptr, Progress *progress=nullptr) |
| ImportResult | import (const std::vector< Import::Entry > &entries, bool copyData, LayersToModify layersToModify, Progress *progress) |
| Imports the given entries to the project. | |
| bool | importLayers (std::vector< SharedImageSet * > layers, LayersToModify layersToModify, Progress *progress=nullptr) |
| ProjectImportResult | importDescriptorsFromProject (const Project &p, Flags< ImportProjectOption > flags, bool dryRun, Progress *progress=nullptr) |
| bool | deleteDescriptors (const std::vector< DataDescriptor * > &descs) |
| void | setCurrentDataSet (std::unique_ptr< DataSet > data) |
| Utils::Expected< DataSet *, std::string > | loadDataSet (DataDescriptor &desc, Progress *progress) |
| bool | unloadCurrentDataSet (Progress *progress) |
| std::unique_ptr< DataSet > | takeCurrentDataSet () |
| void | switchDataSetWithProgress (DataDescriptor &desc, QWidget *parent) |
| Switches to another dataset. | |
| void | setFailureCallback (std::function< FailureActionAndPath(std::string)> callback) |
| Set a callback for failures that require some action from the user. | |
| std::function< FailureActionAndPath(std::string)> | failureCallback () const |
| void | generateMissingThumbnails (Progress *progress=nullptr) const |
| const QString & | name () const |
| const QString & | projectPath () const |
| int | projectId () const |
| Returns the id of the remote project or -1 for local projects. | |
| ProjectTypes | projectType () const |
| DataTypes | dataType () const |
| const QString & | enabledActions () const |
| const std::vector< TagType > & | tagTypes () const |
| const std::set< ResourceLocation > | allowedResourceLocations () const |
| const std::vector< Filesystem::Url > | allowedResourceUrls () const |
| const std::vector< std::unique_ptr< DataDescriptor > > & | dataDescriptors () const |
| DataDescriptor * | findDescriptorFromID (const QString &identifier) const |
| DataSet * | currentData () const |
| Experiments & | experiments () |
| bool | applySettingsChange (const SettingsUpdate &update) |
| TagSystem & | tagSystem () |
| const TagSystem & | tagSystem () const |
| bool | isReadOnly () const |
| bool | isLocal () const |
| bool | isDummy () const |
| bool | isRemote () const |
| bool | supportsDataLinkAndCopy () const |
| bool | supportsExperiments () const |
| const Permissions & | permissions () const |
| Permissions of the current user for this project. | |
| const std::string & | serverVersion () const |
| Version number of the remote server or empty string for local projects. | |
| bool | allowsData2D () const |
| bool | allowsData3D () const |
| bool | allowsDataSingleChannel () const |
| bool | allowsDataMultiChannel () const |
| bool | isDatasetCompatible (const ImageMetadata &meta) const |
| DatasetLicenseSystem & | datasetLicenses () |
| const DatasetLicenseSystem & | datasetLicenses () const |
| bool | applyNewLayers (ProjectTypes newProjectType, std::vector< std::unique_ptr< PixelwiseData > > pixelwiseLayers, const std::vector< TypeMapping > &pixelwiseTypeMapping, std::vector< std::unique_ptr< GeometricAnnotationData > > geometricAnnotationLayers, const std::vector< TypeMapping > &geometricAnnotationTypeMapping, Progress *progress=nullptr) |
| bool | hasMultipleLayers () const |
| const PixelwiseData * | pixelwise (std::optional< size_t >={}) const |
| const GeometricAnnotationData * | geometricAnnotations (std::optional< size_t >={}) const |
| size_t | numberPixelwiseLayers () const |
| size_t | numberGeometricAnnotationLayers () const |
| void | setActivePixelwise (std::optional< size_t >) |
| void | setActiveGeometricAnnotations (std::optional< size_t >) |
| std::optional< size_t > | activePixelwise () const |
| std::optional< size_t > | activeGeometricAnnotations () const |
| const std::vector< std::unique_ptr< PixelwiseData > > & | pixelwiseLayers () const |
| const std::vector< std::unique_ptr< GeometricAnnotationData > > & | geometricAnnotationLayers () const |
| void | configuration (Properties *p) const override |
| Serialize the current object configuration into the given Properties object. | |
| void | configure (const Properties *p) override |
| Configure this object instance by de-serializing the given Properties. | |
| const Network::AuthorizationProvider & | authProvider () const |
| Provides authorization for a remote project and other web resources. | |
| std::shared_ptr< Network::AuthorizationProvider > | authProviderShared () const |
| int | latestRemoteEventTimestamp () const |
| std::optional< int > | queryAndApplyNewerEvents () |
| bool | applyRemoteEvent (int timestamp, const QJsonObject &jsonEvent) |
| QString | loadInstructions () const |
| Loads instructions for this project. | |
| std::vector< std::string > | datasetGroupingHierachy () const |
| Returns the values the project can be grouped by. | |
| void | setDatasetGroupingHierachy (const std::vector< std::string > &grouping) |
| Changes the grouping hierachy. | |
| Container::LRUCache< std::string, Utils::FileGuard > & | localDataCache () const |
| Public Member Functions inherited from ImFusion::SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
| Public Member Functions inherited from ImFusion::Configurable | |
| virtual void | configureDefaults () |
| Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
| void | registerParameter (ParameterBase *param) |
| Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
| void | unregisterParameter (const ParameterBase *param) |
| Remove the given Parameter or SubProperty from the list of registered parameters. | |
| Configurable (const Configurable &rhs) | |
| Configurable (Configurable &&rhs) noexcept | |
| Configurable & | operator= (const Configurable &) |
| Configurable & | operator= (Configurable &&) noexcept |
Static Public Member Functions | |
| static QJsonObject | toJson (Settings settings, const std::vector< TagType > &tagTypes, const std::vector< std::unique_ptr< PixelwiseData > > &pixelwiseLayers, const std::vector< std::unique_ptr< GeometricAnnotationData > > &geometricAnnotationLayers) |
| Converts the project parameters to JSON as used by the server. | |
| static std::unique_ptr< Project > | loadLocalProject (QString projectDir, const Properties &prop, bool readOnly) |
| all the static functions below may throw if the data passed is invalid, with a human-readable exception message | |
| static std::unique_ptr< Project > | loadRemoteProject (const std::string &projectUrl, std::shared_ptr< Network::AuthorizationProvider > authProvider, Progress *progress=nullptr) |
| static std::unique_ptr< Project > | createNewRemoteProject (Settings settings, const std::vector< TagType > &tagTypes, const std::vector< std::unique_ptr< PixelwiseData > > &pixelwiseLayers, const std::vector< std::unique_ptr< GeometricAnnotationData > > &geometricAnnotationLayers, std::shared_ptr< Network::AuthorizationProvider > authProvider, Progress *progress) |
| static std::unique_ptr< Project > | createNewLocalProject (Settings settings, std::vector< std::unique_ptr< PixelwiseData > > pixelwiseLayers, std::vector< std::unique_ptr< GeometricAnnotationData > > geometricAnnotationLayers) |
| static std::unique_ptr< Project > | dummyProject (ProjectTypes t, std::vector< std::unique_ptr< PixelwiseData > > pixelwiseLayers, std::vector< std::unique_ptr< GeometricAnnotationData > > geometricAnnotationLayers) |
| static bool | isDatasetCompatible (const DataTypes &types, const ImageMetadata &meta) |
| static bool | isRemoteProjectPath (const QString &projectPath) |
Public Attributes | |
| Signal | descriptorsAdded |
| Signal< DataDescriptor * > | descriptorModified |
| Signal | descriptorOwningStateChanged |
| Signal< const DataDescriptor * > | descriptorDeletedPre |
| Signal | descriptorsDeleted |
| Signal< const DataDescriptor * > | descriptorThumbnailChanged |
| Signal< const DataDescriptor *, const QString & > | descriptorAnnotationThumbnailChanged |
| Signal< DataSet & > | dataUnloadedPre |
| Signal< const DataDescriptor & > | dataLoadedPre |
| Signal< DataSet & > | dataLoadedPost |
| Signal< SharedImageSet &, Progress * > | imageLoadedPost |
| Signal | nameChanged |
| Signal< const QString &, const QString & > | directoryChanged |
| Signal | tagsChangedPre |
| Signal | tagsChangedPost |
| Signal | layersChangedPre |
| Signal | layersChangedPost |
| Signal | anyActiveLayerChangedPre |
| Signal | anyActiveLayerChangedPost |
| Signal< const PixelwiseData * > | activePixelwiseLayerChanged |
| Signal< const GeometricAnnotationData * > | activeAnnotationLayerChanged |
| Signal< std::string > | unhandledRemoteEvent |
| Public Attributes inherited from ImFusion::Configurable | |
| Signal | signalParametersChanged |
| Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
Static Public Attributes | |
| static const std::string | LoadInterrupted |
Additional Inherited Members | |
| Protected Member Functions inherited from ImFusion::SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
| Protected Attributes inherited from ImFusion::Configurable | |
| std::vector< Param > | m_params |
| List of all registered Parameter and SubProperty instances. | |
|
strong |
|
static |
Converts the project parameters to JSON as used by the server.
If this is a new project, Settings.m_projectPath should be empty and all ids should be -1. New tags, layers or labels should also use ids of -1 when editing an existing project.
| ImportResult ImFusion::Project::import | ( | const std::vector< Import::Entry > & | entries, |
| bool | copyData, | ||
| LayersToModify | layersToModify, | ||
| Progress * | progress ) |
Imports the given entries to the project.
copyData specifies whether the datasets should be copied to the project folder or not. If the entries contain labelmaps, they are imported after the regular datasets (see importLayers for details). The ImportResult object contains info about datasets that could be loaded, those that could not be loaded (and the error message associated)
| void ImFusion::Project::switchDataSetWithProgress | ( | DataDescriptor & | desc, |
| QWidget * | parent ) |
Switches to another dataset.
If there is a currentData, it is saved before loadDataSet is called. This method creates a progress dialog and will show a message box if an error occures. It must therefore only be called from UI code. Use loadDataSet otherwise.
| void ImFusion::Project::setFailureCallback | ( | std::function< FailureActionAndPath(std::string)> | callback | ) |
Set a callback for failures that require some action from the user.
The callback receives a string containing a description of the error. The callback should decide on an action (e.g. with a dialog) and return the result. The callback might be called multiple times (e.g. retrying multiple times).
|
inline |
Permissions of the current user for this project.
For local projects, all permissions are always true.
|
overridevirtual |
Serialize the current object configuration into the given Properties object.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from ImFusion::Configurable.
|
overridevirtual |
Configure this object instance by de-serializing the given Properties.
The default implementation will do so automatically for all registered Parameter and SubProperty instances.
Reimplemented from ImFusion::Configurable.
| const Network::AuthorizationProvider & ImFusion::Project::authProvider | ( | ) | const |
Provides authorization for a remote project and other web resources.
Also available for local projects, in which case it's only used for datasets that are stored as DICOMweb or another web resource.
| QString ImFusion::Project::loadInstructions | ( | ) | const |
Loads instructions for this project.
For remote projects, instructions are loaded from the server. For local projects, instructions are loaded from an instructions.html in the project directory. Returns an empty string if the project doesn't have any instructions.
| std::vector< std::string > ImFusion::Project::datasetGroupingHierachy | ( | ) | const |
Returns the values the project can be grouped by.
By default this is "Patient", "Study", "Series". It corresponds to the ImageMetadata::m_grouping field. Each group depends on the previous, e.g. grouping by "Study" will first group by "Patient" and then by "Study" inside each "Patient" group. This property is mainly used to show the grouping options in the UI.
| void ImFusion::Project::setDatasetGroupingHierachy | ( | const std::vector< std::string > & | grouping | ) |
Changes the grouping hierachy.
This only changes the hierachy in the project, but won't change the current grouping in the datasets (because there is no generic way to determine a mapping). There is currently also no signal, because we assume that this is only changed from scripts and not through the Labels UI.