Fish Scan
Plugin to enhance fish detection and analysis for underwater research
Plugin to enhance fish detection and analysis for underwater research
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Installation¶
You can install fish-scan
via pip:
pip install fish-scan
To install latest development version :
pip install git+https://github.com/ariannaravera/fish-scan.git
Tutorial¶
1. Color correction¶
With this tool you can correct colors in your image.
- Open your image in napari by grabbing and dropping it or opening from the menu
- Click on “Select the area” to select a rectagular area of the color you wanna correct
- Draw the rectangle in the area in which you have that color, eg. white area, as in the example below
- Select the color name in the dropdown box, eg. in this case white
- Click on “Correct color”
- If you’re satisfied of the correction made, it is IMPORTANT to select as input “Image”(first box) the name of the new generated image (usually, “Currect_corrected_...)*
- Cuntinue your colors corrections re-starting from step 2
Nomenclature:¶
- you MUSH have your original image with its original name (in this case “Group2_FishID_25April…”)
- then, once you start correcting the image, the new generated images will be called as “Current_corrected_original-name”
- if you perform the correction more times, your previous corrected image will be named “Previous_corrected_original-name” and the new generated always “Current_corrected_original-name”.
This allows you to keep as “previous” the result that you already liked and approved, while the “current” you can play and experiment new corrections. Be aware that if you select as input image of the correction “previous” this means that you didn’t like the “current” one and it will be overwrite (while the “previous” remain the same), otherwise if you liked the “current” and you use it as input image of the new correction, then the “current” will become “previous” and the new result “current”. At anytime if you want you can re-start from the original image by selecting it as input image (original image is NEVER changed).
2. Set Scale¶
With this tool you can automatically measure your fish if a scale is in the image.
-
Click on “Select 1 cm” and draw a line on the scale represeting 1cm, as in this example:
-
Click on “Set scale” and your fish will be automaticall measure in your final analysis with this scale
3. Segmentation & Analysis¶
With this tool you can segment your fish.
Steps:
-
Select the “Image” you want to analyse (be aware of the nomenclature*)
-
Click “Select fish area” button
-
Start drawing your mask with the brush (yellow arrow below). I suggest to start drwaing the fish contours and then with the paint bucket (red arrow below) fill the inside. Adjust it with the eraser (orange arrow below) if needed
-
Select the output folder you want the results saved in by clicking “Browse”
-
Finally, click on “Analyse the fish” to generate your analysis
Here is an example of the results you obtain from it: • two graphs per image, o one representing the percentage of the 3 dominant color you want to study (black, white and orange)
o one with the composition of the real RGB values found in the image (the ones that are categorized in the 3 main classes you have in graph 1)
• one csv file in which there are the number of black, white and orange pixels, their percentages (same values of graph 1), the length of the fish in pixels (always provided) and the length converted in cm (if a scale was provided). o If in the output folder chosen there were already a previously created csv we will append to that the new info, otherwise a new csv is created.
Contributing¶
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License¶
Distributed under the terms of the BSD-3 license, "fish-scan" is free and open source software
Issues¶
If you encounter any problems, please file an issue along with a detailed description.
Version:
- 1.1.0
Last updated:
- 12 November 2024
First released:
- 14 August 2024
License:
- Copyright (c) 2024, Arianna Ravera All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Supported data:
- Information not submitted
Plugin type:
Open extension:
Save extension:
GitHub activity:
- Stars: 0
- Forks: 0
- Issues + PRs: 0