Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkSAMInstaller Class Reference

#include <QmitkSegmentAnythingPreferencePage.h>

Inheritance diagram for QmitkSAMInstaller:
Collaboration diagram for QmitkSAMInstaller:

Public Member Functions

 QmitkSAMInstaller (const QString baseDir=QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+QDir::separator()+qApp->organizationName()+QDir::separator())
 
bool SetupVirtualEnv (const QString &) override
 Implement the method in child class to setup the virtual environment. More...
 
QString GetVirtualEnvPath () override
 Get the Virtual Env Path object. Override this method in the respective tool installer class. More...
 
- Public Member Functions inherited from QmitkSetupVirtualEnvUtil
 QmitkSetupVirtualEnvUtil (const QString &baseDir)
 
 QmitkSetupVirtualEnvUtil ()
 
void PipInstall (const std::string &library, const std::string &workingDir, void(*callback)(itk::Object *, const itk::EventObject &, void *), const std::string &command="pip3")
 Function to Pip install a library package given the location of pip3 executable. Any callback function can be passed to process the output. More...
 
void PipInstall (const std::string &library, void(*callback)(itk::Object *, const itk::EventObject &, void *), const std::string &command="pip3")
 Overloaded function to Pip install a library function. More...
 
void ExecutePython (const std::string &args, const std::string &pythonPath, void(*callback)(itk::Object *, const itk::EventObject &, void *), const std::string &command="python")
 Function to execute any python code given a python path. Any callback function can be passed to process the output. More...
 
void ExecutePython (const std::string &args, void(*callback)(itk::Object *, const itk::EventObject &, void *), const std::string &command="python")
 Overloaded function to Execute Python code. Any callback function can be passed to process the output. More...
 
void InstallPytorch (const std::string &workingDir, void(*callback)(itk::Object *, const itk::EventObject &, void *))
 Installs pytorch using light-the-torch package, correctly identifying cuda version. Requires location of pip3 executable. Any callback function can be passed to process the output. More...
 
void InstallPytorch ()
 Overloaded function to install pytorch using light-the-torch package, correctly identifying cuda version. More...
 
QString & GetBaseDir ()
 Get the Base Dir object. More...
 
QString & GetSystemPythonPath ()
 Get the System Python Path object. More...
 
QString & GetPythonPath ()
 Get the Python Path object. More...
 
QString & GetPipPath ()
 Get the Pip Path object. More...
 
void SetSystemPythonPath (const QString &path)
 Set the System Python Path object. More...
 
void SetPythonPath (const QString &path)
 Set the Python Path object. More...
 
void SetPipPath (const QString &path)
 Set the Pip Path object. More...
 
void SetVirtualEnvPath (const QString &path)
 Set the Virtual Env Path object. More...
 
bool IsPythonPath (const QString &pythonPath)
 Check if the path provide has python executable or not. More...
 

Public Attributes

const QString VENV_NAME
 
const QString SAM_VERSION
 
const std::vector< QString > PACKAGES
 
const QString STORAGE_DIR
 

Additional Inherited Members

- Static Public Member Functions inherited from QmitkSetupVirtualEnvUtil
static bool IsVenvInstalled (const QString &pythonPath)
 Checks if venv module is available for the python. More...
 
static QString GetPipPackageVersion (const QString &pythonPath, const QString &packageName)
 Returns version of the pip installed package. More...
 
static void PrintProcessEvent (itk::Object *, const itk::EventObject &e, void *)
 Function can be used as callback to simply print out all the process execution output parsed out from itk::EventObject. More...
 
static std::pair< QString, QString > GetExactPythonPath (const QString &pyEnv)
 Get the exact Python path and version for any OS from the virtual environment path. More...
 

Detailed Description

Definition at line 31 of file QmitkSegmentAnythingPreferencePage.h.

Constructor & Destructor Documentation

◆ QmitkSAMInstaller()

QmitkSAMInstaller::QmitkSAMInstaller ( const QString  baseDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QDir::separator() + qApp->organizationName() + QDir::separator())
inline

Definition at line 38 of file QmitkSegmentAnythingPreferencePage.h.

Member Function Documentation

◆ GetVirtualEnvPath()

QString QmitkSAMInstaller::GetVirtualEnvPath ( )
overridevirtual

Get the Virtual Env Path object. Override this method in the respective tool installer class.

Returns
QString

Reimplemented from QmitkSetupVirtualEnvUtil.

◆ SetupVirtualEnv()

bool QmitkSAMInstaller::SetupVirtualEnv ( const QString &  venvName)
overridevirtual

Implement the method in child class to setup the virtual environment.

Implements QmitkSetupVirtualEnvUtil.

Member Data Documentation

◆ PACKAGES

const std::vector<QString> QmitkSAMInstaller::PACKAGES

Definition at line 36 of file QmitkSegmentAnythingPreferencePage.h.

◆ SAM_VERSION

const QString QmitkSAMInstaller::SAM_VERSION

Definition at line 35 of file QmitkSegmentAnythingPreferencePage.h.

◆ STORAGE_DIR

const QString QmitkSAMInstaller::STORAGE_DIR

Definition at line 37 of file QmitkSegmentAnythingPreferencePage.h.

◆ VENV_NAME

const QString QmitkSAMInstaller::VENV_NAME

Definition at line 34 of file QmitkSegmentAnythingPreferencePage.h.


The documentation for this class was generated from the following file: