= GUI()
gui gui.displayed_widget
interfaces
Top-level API:
The following class defines the top-level API of findmycells, which represents the intended way of how users interact with and use findmycells. Also when the graphical user interface is used, the corresponding inputs will communicate with the API
.
API
API (project_root_dir:Union[pathlib.PosixPath,pathlib.WindowsPath])
Intended way of how users interact with findmycells. For a more detailed guide on how this interface shall be used, please check out the available API tutorial(s) on the documentation website of findmycells.
Associated public methods:
API.update_database_with_current_source_files
API.update_database_with_current_source_files ()
Checks the subdirectory in the project root directory that contains the microscopy images for newly added or removed files.
API.set_microscopy_reader_configs
API.set_microscopy_reader_configs (microscopy_reader_configs:Optional[Di ct]=None)
Asserts a valid input and then communicates the configs for how microscopy image data shall be imported to the ProjectConfigs
. Has to be run before any processing can be done.
Type | Default | Details | |
---|---|---|---|
microscopy_reader_configs | typing.Optional[typing.Dict] | None | |
Returns | None |
API.set_roi_reader_configs
API.set_roi_reader_configs (roi_reader_configs:Optional[Dict]=None)
Asserts a valid input and then communicates the configs for how ROI files shall be imported to the ProjectConfigs
. Has to be run before any processing can be done.
Type | Default | Details | |
---|---|---|---|
roi_reader_configs | typing.Optional[typing.Dict] | None | |
Returns | None |
API.preprocess
API.preprocess (strategies:List[findmycells.preprocessing.specs.Preproce ssingStrategy], strategy_configs:Optional[List[Dict]]=None, processing_configs:Optional[Dict]=None, file_ids:Optional[List[str]]=None)
Run specified preprocessing methods on all selected file IDs, using the processing configuration settings as well as the individual configuration settings for each preprocessing strategy (= preprocessing method).
Type | Default | Details | |
---|---|---|---|
strategies | typing.List[findmycells.preprocessing.specs.PreprocessingStrategy] | ||
strategy_configs | typing.Optional[typing.List[typing.Dict]] | None | |
processing_configs | typing.Optional[typing.Dict] | None | |
file_ids | typing.Optional[typing.List[str]] | None | |
Returns | None |
API.segment
API.segment (strategies:List[findmycells.segmentation.specs.Segmentation Strategy], strategy_configs:Optional[List[Dict]]=None, processing_configs:Optional[Dict]=None, file_ids:Optional[List[str]]=None)
Run specified segmentation methods on all selected file IDs, using the processing configuration settings as well as the individual configuration settings for each segmentation strategy (= segmentation method).
Type | Default | Details | |
---|---|---|---|
strategies | typing.List[findmycells.segmentation.specs.SegmentationStrategy] | ||
strategy_configs | typing.Optional[typing.List[typing.Dict]] | None | |
processing_configs | typing.Optional[typing.Dict] | None | |
file_ids | typing.Optional[typing.List[str]] | None | |
Returns | None |
API.postprocess
API.postprocess (strategies:List[findmycells.postprocessing.specs.Postpro cessingStrategy], strategy_configs:Optional[List[Dict]]=None, processing_configs:Optional[Dict]=None, file_ids:Optional[List[str]]=None)
Run specified postprocessing methods on all selected file IDs, using the processing configuration settings as well as the individual configuration settings for each postprocessing strategy (= postprocessing method).
Type | Default | Details | |
---|---|---|---|
strategies | typing.List[findmycells.postprocessing.specs.PostprocessingStrategy] | ||
strategy_configs | typing.Optional[typing.List[typing.Dict]] | None | |
processing_configs | typing.Optional[typing.Dict] | None | |
file_ids | typing.Optional[typing.List[str]] | None | |
Returns | None |
API.quantify
API.quantify (strategies:List[findmycells.quantification.specs.Quantifica tionStrategy], strategy_configs:Optional[List[Dict]]=None, processing_configs:Optional[Dict]=None, file_ids:Optional[List[str]]=None)
Run specified quantification methods on all selected file IDs, using the processing configuration settings as well as the individual configuration settings for each quantification strategy (= quantification method).
Type | Default | Details | |
---|---|---|---|
strategies | typing.List[findmycells.quantification.specs.QuantificationStrategy] | ||
strategy_configs | typing.Optional[typing.List[typing.Dict]] | None | |
processing_configs | typing.Optional[typing.Dict] | None | |
file_ids | typing.Optional[typing.List[str]] | None | |
Returns | None |
API.initialize_inspection
API.initialize_inspection (inspection_method_class:findmycells.inspectio n.methods.InspectionMethod, file_id:str, area_roi_id:str, plane_idx:Optional[int]=None)
Prepare the inspection of a given file. This intermediate step is required especially to handle processing in the GUI.
Type | Default | Details | |
---|---|---|---|
inspection_method_class | InspectionMethod | ||
file_id | str | ||
area_roi_id | str | ||
plane_idx | typing.Optional[int] | None | |
Returns | InspectionMethod |
API.inspect
API.inspect (inspection_method_obj:findmycells.inspection.methods.Inspec tionMethod, center_coords:Tuple[int,int], inspection_configs:Dict[str,Any])
Run the selected inspection method, focusing on the provided center coordinates (row idx, column idx) and applying the specified inspection configuration settings.
Type | Details | |
---|---|---|
inspection_method_obj | InspectionMethod | |
center_coords | typing.Tuple[int, int] | (row idx, column idx) |
inspection_configs | typing.Dict[str, typing.Any] | |
Returns | None |
API.export_quantification_results
API.export_quantification_results (export_as:str='xlsx')
As soon as all processing steps and quantifications are done, run this method to export all quantification results to the results subdirectory in the project root dir.
Type | Default | Details | |
---|---|---|---|
export_as | str | xlsx | ‘xslx’ or ‘csv’ |
Returns | None |
API.save_status
API.save_status ()
Saves the current status of the findmycells project in the project root directory. The data will be split into two files and current date will be used as prefix.
API.load_status
API.load_status (project_configs_filepath:Union[pathlib.PosixPath,pathlib .WindowsPath,NoneType]=None, database_filepath:Union[pat hlib.PosixPath,pathlib.WindowsPath,NoneType]=None)
Loads the project status of a findmycells project from the two files (see save_status()) from the project root directory.
Type | Default | Details | |
---|---|---|---|
project_configs_filepath | typing.Union[pathlib.PosixPath, pathlib.WindowsPath, NoneType] | None | |
database_filepath | typing.Union[pathlib.PosixPath, pathlib.WindowsPath, NoneType] | None | |
Returns | None |
Graphical user interface
The following classes are used to create the graphical user interface of findmycells. Please note that classes will be listed here in an inverted hirarchy, such that you can find the main GUI
class at the very end, and classes that handle much more specific details at the beginning.
StrategyConfigurator
StrategyConfigurator (available_strategy_classes:List, parent_accordion:ipywidgets.widgets.widget_selectio ncontainer.Accordion, target_for_configs_export:List)
This class implements the interface that let´s the user choose and configurate the processing strategies. It will be placed inside of an accordion that is implemented in the ProcessingStepPage
. It gets a list of all available processing strategies from the parent ProcessingStepPage
and, thus, eventually from the API
that checks for all available processing strategies in the corresponding processing submodule (e.g. “findmycells.preprocessing.strategies”). Upon initializing it´s dropdown widget, which let´s the user browser through the different available strategies, it also initializes an object of each strategy. This object can then be used to run it´s associated method “.initialize_gui_configs_and_widget()” to build the specified widget, using its GUIConfigs
instance. Essentially, this contains a description of what the processing strategy does and, if applicable, widgets to specify all parameters that can be configurated for this strategy. Finally, a “confirm & export” and a “remove” button allow the user to load or delete the current to or from the findmycells project, respectively.
SettingsPage
SettingsPage (bundle_id:str, page_screen:traitlets.traitlets.MetaHasTraits, all_navigator_buttons:List, api:__main__.API)
Subclass of PageButtonBundle
that implements the GUI interface that allows the user to specify all settings relevant to the findmycells project. It also enables saving & loading of the project status, and to browse through the file history that is automatically created by findmycells.
ProcessingStepPage
ProcessingStepPage (bundle_id:str, page_screen:traitlets.traitlets.MetaHasTraits, all_navigator_buttons:List, api:__main__.API)
Helper class that provides a standard way to create an ABC using inheritance.
InspectionPage
InspectionPage (bundle_id:str, page_screen:traitlets.traitlets.MetaHasTraits, all_navigator_buttons:List, api:__main__.API)
Helper class that provides a standard way to create an ABC using inheritance.
GUI
GUI (project_root_dir:Union[pathlib.PosixPath,pathlib.WindowsPath,NoneTyp e]=None)
Initialize self. See help(type(self)) for accurate signature.
Type | Default | Details | |
---|---|---|---|
project_root_dir | typing.Union[pathlib.PosixPath, pathlib.WindowsPath, NoneType] | None | Instead of using the FileChooser, you can also provide the Path to your project root dir right away |
Returns | None |
The recommended way to create and use the GUI of findmycells:
The advantage of this method is that you will have the GUI
object available in your jupyter notebook, which allows you to also interact with it using your notebook, which can be very helpful in case you have to do some troubleshooting. However, if this is not needed, you can also simply use the following function to launch the GUI. Feel free to check out our GUI tutorial for a more in-depth user guide.
launch_gui
launch_gui (project_root_dir:Union[pathlib.PosixPath,pathlib.WindowsPath, NoneType]=None)
Function to launch the GUI of findmycells. Comes, however, with the disadvantage of not having the GUI object available. You can pass the desired root directory as pathlib.Path object along, which will then be pre-set as the path in the initial file chooser widget, which can save you some time instead of clicking through a bunch of directories.