Package: ovary-analysis
ovary-analysisovary-analysisis a python package for analysis of ovarian follicles from ultrasound images.ovary-analysiscontains
thefollicle-finderpipeline for the automated segmentation and measurement of ovarian follicles.Graphical User InterfaceIf you would like a graphical user interface for thefollicle-findersegmentation pipeline, please see ourfollicle-trackernapari plugin..UsageSegmentation and measurementYou can perform automated segmentation and measurement via the FollicleFinder command line interface. To see options
of FollicleFinder you can typefollicle-finder --helpin your terminal (you must first activate your
`follicle-finder environment).$follicle-finder--help
usage:follicle-finder[-h][-iIMAGE_PATH][--image-keyIMAGE_KEY][--ovary-seg-configOVARY_SEG_CONFIG][--follicle-seg-configFOLLICLE_SEG_CONFIG][--ovary-modelOVARY_MODEL][--follicle-modelFOLLICLE_MODEL][--ovary-probability-thresholdOVARY_PROBABILITY_THRESHOLD][--ovary-dilation-sizeOVARY_DILATION_SIZE][--follicle-probability-thresholdFOLLICLE_PROBABILITY_THRESHOLD][--follicle-volume-thresholdFOLLICLE_VOLUME_THRESHOLD][-oOUTPUT_DIRECTORY]optionalarguments:-h,--helpshowthishelpmessageandexit-iIMAGE_PATH,--imageIMAGE_PATHrawimagepath(default:None)--image-keyIMAGE_KEYrawimagekey(default:raw_rescaled)--ovary-seg-configOVARY_SEG_CONFIGpathtotheovarysegmentationconfigurationfile(default:)--follicle-seg-configFOLLICLE_SEG_CONFIGpathtothefolliclesegmentationconfigurationfile(default:)--ovary-modelOVARY_MODELpathtotheovarymodel.ifnotprovided,built-inmodelisused.(default:)--follicle-modelFOLLICLE_MODELpathtothefolliclemodel.ifnotprovided,built-inmodelisused.(default:)--ovary-probability-thresholdOVARY_PROBABILITY_THRESHOLDprobabiltythresholdforbinarizingovaryprediction(default:0.8)--ovary-dilation-sizeOVARY_DILATION_SIZEsizeofthedilationtoperformontheovarysegmentation(default:10)--follicle-probability-thresholdFOLLICLE_PROBABILITY_THRESHOLDprobabiltythresholdforbinarizingfollicleprediction(default:0.5)--follicle-volume-thresholdFOLLICLE_VOLUME_THRESHOLDminimumvolume(# voxels) for a follicle to be included (default: 30)-oOUTPUT_DIRECTORY,--outputOUTPUT_DIRECTORYoutputdirectorypath(default:)To perform segmentation with the default options you can enter the following into your terminal$follicle-finder--image/path/to/image--output/path/to/output/directorywhere/path/to/imageis the path to your image to be segmented and/path/to/output/directoryis the path to the
directory in which the results will be saved. Following the completion of the pipeline, you find two files in your
output directory:segmentation.h5: the segmentated image with the follicles in thefollicleskey and the ovary in theovarykey.measurements.csv: the table of measurements for each detected follicle.If you would like to perform segmentation with your own model (see instructions for training below), you can use the
following command:$follicle-finder--image/path/to/image--ovary-model/path/to/ovary/model--follicle-model/path/to/follicle/model--output/path/to/output/directorywhere/path/to/ovary/modelandpath/to/follicle/modelare the paths to the ovary and follicle models, respectively.Training a modelWe have included example scripts for training and performing cross validation in theexamplesdirectory. Due to
the compute time of training and cross validation, we have designed these scripts for usage with a scientific
compute cluster with an LSF job queue. Please file an issue if you would like help running on a different computing
setup.ovary model:examples/make_ovary_cross_validation.pyfollicle model:examples/make_follicle_cross_validation.pyInstallationPre-requisitescomputer with an nvidia GPU. We have tested on a P1000, P4000, and RTX2080Ti.CUDA > 11.3 installed on the computeranaconda or miniconda pythonInstallation with condaYou can installfollicle-findervia our conda environment file. To do so, first install anaconda or miniconda on
your computer. Then, download theenvironment_denoise.yml file(right click the link and "Save as..."). In
your terminal,
navigate to the directory you downloaded theenvironment_denoise.ymlfile to:cd<path/to/downloaded/environment_denoise.yml>Then create thefollicle-finderenvironment andcondaenvcreate-fenvironment.ymlOnce the environment has been created, you can activate it and usefollicle-finderas described below.condaactivatefollicle-finderDevelopment installationYou can set up your development environment with our conda dev environment file. To do so, first install
anaconda or miniconda on your computer. Then, download theenvironment_dev.yml file(right click the link and "Save as..."). In your
terminal, navigate to the directory you downloaded theenvironment_dev.ymlfile to:cd<path/to/downloaded/environment_dev.yml>Then create thefollicle-trackerenvironment andcondaenvcreate-fenvironment_dev.ymlOnce the environment has been created, you can activate it and installfollicle-finderas described below.condaactivatefollice_trackerNavigate to the directory you would like to download theovary-analysisrepository to and then clone the
follicle-tracker repository.cd/path/to/repo/parent/directory
gitclonegit@git.bsse.ethz.ch:iber/ovary-analysis.gitNavigate into theovary-analysisdirectory and install in editable mode with all dependencies.cdovary-analysis
pipinstall-e.We use pre-commit to ensure code style is uniform across the repository. To set up pre-commit, run the following in
your terminal.pre-commitinstall