StrokeSegLab
Loading...
Searching...
No Matches
StrokeSegLab.postprocessing.viewer.Viewer Class Reference

Public Member Functions

None __init__ (self)
 
None update_path (self)
 
None check_viewer (self, str viewer)
 
None run (self, str img_path, str seg_path)
 

Public Attributes

 config = Config()
 
 logger = logging.getLogger()
 
list viewers = self.config.get('default', 'viewers').split(',')
 
str viewers = "Windows":
 

Detailed Description

This class handle viewers : updating path, checking availability and running it

Constructor & Destructor Documentation

◆ __init__()

None StrokeSegLab.postprocessing.viewer.Viewer.__init__ ( self)
Initialize the viewer class 
- Setting up config, logger and viewers (List of viewers supported by the application)
- Check if the default viewer is available; if not, calling for an update.

Member Function Documentation

◆ check_viewer()

None StrokeSegLab.postprocessing.viewer.Viewer.check_viewer ( self,
str viewer )
Check if a viewer given is supported by the application and available on the path. If not raise an error based on the type of error. Only used in CLI mode, GUI users can simply select from a list of available viewers. If the viewer is available, set it as default one

Args:
    viewer (str): name of the viewer

◆ run()

None StrokeSegLab.postprocessing.viewer.Viewer.run ( self,
str img_path,
str seg_path )
Open the base image and the generated segmentation in the default viewer. If an error occurs, call for an update of the viewers paths

Args:
    img_path (str): Base image path (input)
    seg_path (str): Binary mask path (output)

◆ update_path()

None StrokeSegLab.postprocessing.viewer.Viewer.update_path ( self)
Update all the path for the viewers supported by the application. Set a viewer available on the path as the default one

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