This page assumes you have downloaded and set up PerovStats. If not, please follow the instructions found in installation.md.
If you have any issues please email t.allwood@sheffield.ac.uk - I will get back to you as soon as I can
This is the demo notebook for an explanation on running PerovStats and the processes it goes through. Use this notebook first to see how AFM files will be processed. As this is for example purposes, only one file can be inputted per run.
-
The first code block is for imports and can be ignored. In the second code block there are paths for you to edit:
-
img_fileThe input filepath (.spm or other). Two files are provided for you to test, simply remove the
#from one and add it to the start of the other to switch files. Alternatively you can add your own filepath to run the program on. -
output_dirThe directory to save the results and output to. If the folder does not exist this will be created while running PerovStats.
-
config_pathThe configuration file (
.yaml) to be used in the program's run. For the demo notebook this can be left as is and default configuration options will be used.(For help creating a custom config file refer to the config documentation)
-
-
You can now start running the cells (one at a time or all at once). Images will appear through the notebook as cells run showing you the latest stage of the process. The segmentation cell may take a few minutes to complete, if no error message shows assume everything is running as expected.
-
Images of the scan, graphs,
.csvfiles and a copy of the configuration options used will be saved to the output directory you chose earlier.
This is the main notebook to use when running PerovStats, and allows multiple files to be processed in one run
-
The first code block is for imports and can be ignored. In the second code block there are paths for you to edit:
-
img_filesThe folder containing all images you want to process.
-
output_dirThe directory to save the results and output to. If the folder does not exist this will be created while running PerovStats.
-
config_pathThe configuration file (
.yaml) to be used in the program's run. For the demo notebook this can be left as is and default configuration options will be used.
-
-
You can now start running the cells (one at a time or all at once). Once all input images have been loaded they will be looped through one by one and processed. You can see log messages on the progress of the program as it progresses down the notebook.
-
Images of the scan, graphs,
.csvfiles and a copy of the configuration options used will be saved to the output directory you chose earlier.
-
In your command prompt/ terminal, navigate to the main PerovStats folder (the folder with subfolders such as
/docs/and/src/in it) -
Ensure you have started you virtual environment. If you do not see
(venv)on the left of the command lines type:- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
(venv)should now appear and you are ready to run PerovStats - Windows:
- The program can be run with the command
perovstats. This will use the default settings and take config options fromdefault_config.yamlfound in/src/perovstats/default_config.yaml. Please do not move this file.
-
Other than inputting a custom config file (see config documentation) common arguments can be passed from the terminal when running PerovStats.
-
The arguments available are:
-
--helpor-h- Display a menu showing each command detailed here.
perovstats --help
- Display a menu showing each command detailed here.
-
--config_fileor-c-
Give a custom config file which will override the default settings (again, see configuration documentation for details).
perovstats -c "C:/path/to/config.yaml" process
-
-
--base_diror-d-
Select the folder on your computer you would like to look for data files in.
Note: This requires a folder rather than a data file
perovstats -d "C:/path/to/data_files/" process
-
-
--file_extor-e-
Select the file extension of the scans you have (e.g. ".spm" or ".001")
perovstats -e ".spm" process
-
-
--channelor-n-
Select the channel to use from the AFM scan (e.g. "Height")
perovstats -n "Height" process
-
-
--output_diror-o-
Directory to output resultant images + data to
Note: An
/output/folder will be created inside this directory and files will be saved inside thisperovstats -o "C:/path/to/output/folder/" process
-
-
--segmentationor-s-
Choose the segmentation method for finding grains in an image. Options are 'traditional' or 'cellpose' (see the segmentation documentation for details on each of these).
perovstats -s "traditional" process
-
-
-
You can include multiple arguments in one command by adding a space between them:
perovstats -s cellpose -e ".spm" process
