diff --git a/.github/workflows/Deploy_Morpholgy.yml b/.github/workflows/Deploy_Morpholgy.yml new file mode 100644 index 0000000..2735986 --- /dev/null +++ b/.github/workflows/Deploy_Morpholgy.yml @@ -0,0 +1,41 @@ +name: Create and publish a Docker image + +on: + release: + types: [published] + +env: + REGISTRY: ghcr.io + PROJECT_NAME: ${{ github.repository }} + IMAGE_NAME: MORPHOLOGY + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.PROJECT_NAME }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Scripts/Dockerfile b/Dockerfile similarity index 61% rename from Scripts/Dockerfile rename to Dockerfile index 6c7dc71..9ac8911 100644 --- a/Scripts/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM ubuntu:20.04 # Label -LABEL org.opencontainers.image.title="fish cropping and trait morphology" +LABEL org.opencontainers.image.title="fish morphological trait extraction" LABEL org.opencontainers.image.authors=" T. Tabarin" -LABEL org.opencontainers.image.source="https://github.com/hdr-bgnn/BGNN_Snakemake" +LABEL org.opencontainers.image.source="https://github.com/hdr-bgnn/Morphology-analysis" # Install some basic utilities RUN apt-get update && apt-get install -y \ @@ -33,7 +33,7 @@ RUN chmod 777 /home/user # Set up the Conda environment ENV CONDA_AUTO_UPDATE_CONDA=false \ PATH=/home/user/miniconda/bin:$PATH -COPY morphology_env.yml /app/environment.yml +COPY Scripts/morphology_env.yml /app/environment.yml RUN curl -sLo ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.9.2-Linux-x86_64.sh \ && chmod +x ~/miniconda.sh \ && ~/miniconda.sh -b -p ~/miniconda \ @@ -46,14 +46,10 @@ WORKDIR /pipeline # Setup pipeline specific scripts ENV PATH="/pipeline/Morphology:${PATH}" -ENV PATH="/pipeline/Crop:${PATH}" -ENV PATH="/pipeline/Merge_files:${PATH}" -ADD Crop_image/Crop_image_main.py /pipeline/Crop/Crop_image_main.py -ADD Morphology/Traits_class.py /pipeline/Morphology/Traits_class.py -ADD Morphology/Morphology_main.py /pipeline/Morphology/Morphology_main.py -ADD Merge_files/Merge_files_main.py /pipeline/Merge_files/Merge_files_main.py + +ADD Scripts/Traits_class.py /pipeline/Morphology/Traits_class.py +ADD Scripts/Morphology_main.py /pipeline/Morphology/Morphology_main.py # Set the default command to a usage statement -CMD echo "Usage crop: Crop_image_main.py \n"\ -"Usage Morphology: Morphology_main.py \n"\ -"Usage Merge_file: Merge_files_main.py " +CMD echo "Usage Morphology: Morphology_main.py \n"\ + diff --git a/README.md b/README.md index 532ffb9..e65f4f0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,150 @@ # Morphology-analysis Extract morphological characteristics from trait segmented fish + +The goals of the tool is to extract measurments and landmarks of fish from the segmented fish iamge porduce by [Maruf code](). +It provides a framework with various tools such as class and notebook to help further development. +Another goal is to release working version to in container for easy integration into workflow such as [BGNN_Snakemake] +This tool is a part of a bigger project, find the overview [here] + +## 1- Segmented image .png description + +The segmented image input looks like this. It is produced using Maruf segementation (semantic) code based on CNN (unet) deeplearning algorithm, more description on the repo. The output is 11 classes (11 trait : 'dorsal_fin', 'adipos_fin', 'caudal_fin, 'anal_fin', 'pelvic_fin', 'pectoral_fin', 'head', 'eye', 'caudal_fin_ray, 'alt_fin_ray', 'trunk') that are color coded. + +![segmented fish image](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_segmented.png) + +Need the color legend. + +When you export this image in python using pillow library (PIL.Image.open(file_name)), the corresponding color coding in RGB is +{'background': [0, 0, 0], +'dorsal_fin': [254, 0, 0], +'adipos_fin': [0, 254, 0], +'caudal_fin': [0, 0, 254], +'anal_fin': [254, 254, 0], +'pelvic_fin': [0, 254, 254], +'pectoral_fin': [254, 0, 254], +'head': [254, 254, 254], +'eye': [0, 254, 102], +'caudal_fin_ray': [254, 102, 102], +'alt_fin_ray': [254, 102, 204], +'trunk': [0, 124, 124]} + +The approach we take is the following : + + 1. We isolate each indivual traits + 2. We remove small blob and fill holes + 3. We identify landmarks (defined in section 2-) + 4. We use landmarks and morphological tools (centroid, area...) to assess the measurement (**external characters**) + + +## 2- Landmarks and measurement + +We use the following landmarks and measurement labels and description. If you had more features in the class and codes to extract landmarks or measurement, please update the image description and table. + +![Fish landmarks](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Traits_description/Minnows_Landmarks_v1.png) + +![Fish measurment](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Traits_description/Minnows_Measurments_v1.png) + +**Landmarks Table** + +type | landmarkNumber | terminology | position | anatomicalDefinition | codeDefinition +----------|------------------|----------------------------------------------|----------------------------------------------------------------|------------------------|---------------- +landmark | 1 | Tip of snout | anterior-most (left-most) part of head | | +landmark | 2 | Beginning of the scales at the dorsal side | dorsal (top) of head that meets the trunk | | +landmark | 3 | Anterior insertion of the dorsal fin | anterior-most (left-most) insertion point of dorsal fin | | +landmark | 4 | Posterior insertion of dorsal fin | posterior-most (right-most) insertion point of dorsal fin | | +landmark | 5 | Dorsal insertion of the caudal fin | anterior/dorsal (upper left) insertion point of caudal fin | | +landmark | 6 | End of vertebral column | midline of caudal fin | | +landmark | 7 | Ventral insertion of the caudal fin | anterior/ventral (lower left) insertion point of caudal fin | | +landmark | 8 | Posterior insertion of the anal fin | posterior-most (right-most) insertion point of anal fin | | +landmark | 9 | Anterior insertion of the anal fin | anterior-most (left-most) insertion point of anal fin | | +landmark | 10 | Anterior insertion of the pelvic fin | anterior-most (left-most) insertion point of pelvic fin | | +landmark | 11 | Superior insertions of the pectoral fin | anterior-most (left most) insertion point of pectoral fin | | +landmark | 12 | Most dorsal point of operculum | posterior-most (right-most) part of head | | +landmark | 13 | Most ventral point of operculum | dorsal (lower) part of head that meets the trunk | | +landmark | 14 | anterior-most (left-most) part of eye | anterior-most (left-most) part of eye | | +landmark | 15 | posterior-most (right-most) part of eye | posterior-most (right-most) part of eye | | + +**Measurement Table** +trait | abbreviation | type | anatomicalDefinition | codeDefinition +----------------------------------|----------------|------------|------------------------------------------------------------------------------------------------------------------------------------------------|---------------- +standard length | SL | distance | length from the tip of the snout to the posterior-most part of trunk that meets the caudal fin | +eye area | EA | area | area of the eye | +head area, triangle | HAt | area | area of head as outlined by three points: tip of snout (landmark #1), back of head (landmark #2), and ventral portion of head (landmark #13) | +head area, pixels | HAp | area | area of head based on number of pixels | +eye area to head area | EHA | area | ratio of eye area to head area | +head-to-caudal length | HCL | distance | length along the dorsal side (top) from the back of the head (landmark #2) to the end of the peduncle (landmark #5) | +eye diameter | ED | distance | length across the eye along the anterior-posterior (left-right) axis (landmarks #14 & #15) | +head length | HL | distance | length from the anterior-most (left-most) part of the head (landmark #1) to the posterior-most (right-most) part of the head (landmark #12) | +head depth | HD | distance | length from the dorsal-most (top) part of the head (landmark #2) to the ventral-most (bottom) part of the head (landmark #13) | +snout length or preorbital depth | pOD | distance | length from the anterior-most (left-most) part of the eye (landmark #14) to the anterior-most (left-most)part of the head (landmark #1) | + +## 3- Class description + +We create a class to add more fexibility and give a frame work for further developement. Here is a short description of the class "Trait_class", couples functionality and usage. The best way understand it is to play with the class using the Notebook. + +1. Class Overview ++ Class Name : Trait_class ++ Location : Trait_class.py ++ Description : This class create an object "segmented_image" from [segmented_image.png](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Scripts/test_images/INHS_FISH_000742_segmented.png). Upon the initialization (creation of the object), the image.png is imported converted and is split in several channel corresponding to the traits (trunk, dorsal fin...) in the form of dictionnary with key = trait and value a mask. Then multiple function will extract information on individual channel. + +### Usage and main fucntion: +2. Quick start +Create a segmented image object +``` +import Trait_class as tc +img_seg = tc.segmented_image("image_segmented.png") +``` +3. Main functions: + + img_seg.get_channels_mask() : Create a dictionnary key = trait, value = mask for the trait + + img_seg.get_presence_matrix() : Create presence matrix + + img_seg.all_landmark() : found the landmarks + + img_seg.all_measure() : calculate the measurment + +## 4- Input and Output +The main script is Morphology_main.py The usage is python Morphology_main.py input_file.png metadata.json measure.json landmark.json presence.json image_lm.png +Code to test using the data provided in [/Test_Data/]() +``` +Morphology_main.py Test_Data/INHS_FISH_18609_segmented.png Test_Data/INHS_FISH_18609.js +on Test_Data/INHS_FISH_18609_measure.json Test_Data/INHS_FISH_18609_landmark.json Test_Data/INHS_FISH_18609_presence.json Test_Data/INHS_FISH_18609_image_lm.png +``` + + + input_file.png : segmented fish image generated by [Maruf code](), [example here](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_segmented.png) + + metadata.json : generated by [drexel]() [example here](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742.json) + + measure.json : dictionnary, key = measure label, value = calculated value [example](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_measure.json) + + landmark.json : dictionnary, key = landmark label, value = calculated value [example](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_landmark.json) + + presence.json : nested dictionnaries, {key_1 = trait_name { key_2 = "number", value_2 = number of blob, key_3 = "percent", value percentage of the biggest blob}} [example](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_presence.json) + + image_lm.png : original segmented fish image superimposed with landmark position and label [example here](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Test_Data/INHS_FISH_000742_image_lm.png) + +## 5- Notebook to play +In development, you can check [this notebook](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Scripts/Morphology_dev.ipynb) +You will need to use [Morphology_env.yml](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Scripts/morphology_env.yml) to set up your environment before working (required dependencies). I recommend conda, miniconda as environment manager. + + +## 6-Container, usage and release + +We use github action to create a container what run the main script [Morphology_main.py](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Scripts/Morphology_main.py). + 1. The workflow to build the container is defined [here](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/.github/workflows/Deploy_Morpholgy.yml). + 2. The Dockerfile definition is [here](https://github.com/thibaulttabarin/Morphology-analysis/blob/main/Dockerfile) + 3. Pull command : + ``` + docker pull ghcr.io/thibaulttabarin/morphology-analysis/morphology:latest + #or + singularity pull My_morphology_name.sif docker://ghcr.io/thibaulttabarin/morphology-analysis/morphology:latest + ``` + 4. To access the instruction Run : " + ``` + singularity run My_morphology_name.sif + ``` + 5. Usage : + ``` + singularity exec My_morphology_name.sif Morphology_main.py + # test with + singularity exec My_morphology_name.sif Morphology_main.py Test_Data/INHS_FISH_18609_segmented.png Test_Data/INHS_FISH_18609.json Test_Data/INHS_FISH_18609_measure.json Test_Data/INHS_FISH_18609_landmark.json Test_Data/INHS_FISH_18609_presence.json Test_Data/INHS_FISH_18609_image_lm.png + ``` +## 7- Development tricks + +If you want to test neww version of Morphology_main.py (upudated version on your local computer) you can use the container by bind the local folder (here, Scripts/) containing the updated version of Morphology_main.py and /pipeline/Morphology is where Morphology_main.py is expected to be in the container. +``` +singularity exec --bind Scripts/:/pipeline/Morphology morpho.sif Morphology_main.py Test_Data/INHS_FISH_18609_segmented.png Test_Data/INHS_FISH_18609.json Test_Data/INHS_FISH_18609_measure.json Test_Data/INHS_FISH_18609_landmark.json Test_Data/INHS_FISH_18609_presence.json Test_Data/INHS_FISH_18609_image_lm.png + +``` diff --git a/Scripts/.ipynb_checkpoints/Morphology_dev-checkpoint.ipynb b/Scripts/.ipynb_checkpoints/Morphology_dev-checkpoint.ipynb new file mode 100644 index 0000000..87e6a5a --- /dev/null +++ b/Scripts/.ipynb_checkpoints/Morphology_dev-checkpoint.ipynb @@ -0,0 +1,1063 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "98a152cd", + "metadata": {}, + "source": [ + "# Development for morphology trait extraction\n", + "\n", + "This notebook gives examples and a platform to develop and visualize extraction on morphological traits\n", + "The functions used are define in a class \"Traits_class\" that you can find in the same folder (Morphology-analysis/Scripts/Traits_class.py).\n", + "If you want modify the \"Traits_class.py\" reload the module by running the first cell to see the modification appear in the notebook.\n", + "\n", + "**Study case:**\n", + "To illustrate the morphology workflow and functionality, we are using the 2 images :\n", + "\n", + " + Morphology-analysis/Test_Data/INHS_FISH_000742_segmented.png\n", + " + Morphology-analysis/Test_Data/INHS_FISH_18609_segmented.png\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "602dc370", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 35, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# load what you need\n", + "import Traits_class as tc\n", + "import json, sys\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from PIL import Image, ImageDraw, ImageFont\n", + "from IPython.display import Image\n", + "import importlib\n", + "import skimage as ski\n", + "importlib.reload(tc)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "e620246b", + "metadata": {}, + "outputs": [], + "source": [ + "# load the test image, you can add more test image if you have bug related to specific images.\n", + "segmented_file = '../Test_Data/INHS_FISH_000742_segmented.png'\n", + "metadata_file = '../Test_Data/INHS_FISH_000742.json'" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "2289de98", + "metadata": {}, + "outputs": [], + "source": [ + "# Create the object segmented image create by the class during initialisation\n", + "img_seg = tc.segmented_image(segmented_file)\n", + "\n", + "# oupput the variables create at initialization time\n", + "measurement = img_seg.measurement\n", + "landmark = img_seg.landmark\n", + "presence_matrix = img_seg.presence_matrix\n", + "img_landmark = img_seg.visualize_landmark()" + ] + }, + { + "cell_type": "markdown", + "id": "070251e3", + "metadata": {}, + "source": [ + "## 2 - Explore the output\n", + "\n", + " 1- Presence Matrix\n", + " 2- Landmark\n", + " 3- Visualize landmark\n", + " 4- measurement" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "ae9eb407", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'dorsal_fin': {'number': 1, 'percentage': 1.0},\n", + " 'adipos_fin': {'number': 0, 'percentage': 0},\n", + " 'caudal_fin': {'number': 1, 'percentage': 1.0},\n", + " 'anal_fin': {'number': 1, 'percentage': 1.0},\n", + " 'pelvic_fin': {'number': 1, 'percentage': 1.0},\n", + " 'pectoral_fin': {'number': 1, 'percentage': 1.0},\n", + " 'head': {'number': 1, 'percentage': 1.0},\n", + " 'eye': {'number': 1, 'percentage': 1.0},\n", + " 'caudal_fin_ray': {'number': 0, 'percentage': 0},\n", + " 'alt_fin_ray': {'number': 0, 'percentage': 0},\n", + " 'trunk': {'number': 2, 'percentage': 0.992120507069956}}" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# presence dictionnary\n", + "presence_matrix" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "b24d03d1", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'SL': 586.0034129593445,\n", + " 'EA': 922,\n", + " 'HAt': 8437.999999999995,\n", + " 'HAp': 16034,\n", + " 'HCL': 'WIP',\n", + " 'ED': 34.262616074167774,\n", + " 'HL': 151.64761785138597,\n", + " 'HD': 158.3161394173064,\n", + " 'pOD': 32.31098884280702}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# measurement dictionnary\n", + "measurement" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "ffda5440", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'1': (148, 36),\n", + " '2': (66, 148),\n", + " '3': (21, 301),\n", + " '4': (106, 566),\n", + " '5': (112, 606),\n", + " '6': (150, 622),\n", + " '7': (203, 592),\n", + " '8': (200, 562),\n", + " '9': (242, 478),\n", + " '10': (279, 305),\n", + " '11': (217, 169),\n", + " '12': (162, 187),\n", + " '13': (224, 138),\n", + " '14': (136, 66),\n", + " '15': (134, 96)}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# landmark dictionnary\n", + "landmark" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "8b7d1b1a", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAAY90lEQVR4nO3dbW6jyrqA0Tooo7gjPIOILGR5EFt7gGcUkXV/4KYJxhgwUF9rqdXqdBzHSbvtJ28VOAQAAAAAAAAAAAAAAEjEf2LfAKAW99n3NifdCoAzCCxgT/MVNU9jAcUQWMB2n+TUJI0FlEFgAUvtnlOTNBZQgK/YNwBI2jlRBVAYEyyoXYIJZYgF5E5gQUUSbKlXNBaQNYEFMbVtO/PmhzLKqUkaC8iXwII4Zlrqk8zKPaq2kWJAagQWnG1hPy3PrDqjaiHtBUQhsOBUq6ZTkxeWUzuSX8BBnKYBMiCqDjL6xuotYC8mWHCefiL1/IdXLrtue2chpQV8yMMInK2LquHvpOb+5xfANiZYcJLnllrYWIZYSfFTKbCEPVgQwfIlQlIzHGuJLeAVjw8QQdu2lggLYBkReMUEC84mrQrTN5YfWIGePVjwse/vJZdqv/7+PLNqibD9+bnfbltuGPGILaicwIIFliXUW8PGWvohPz+jvxFb2RFbUCFLhPBkp5w6SDN78+RXgqwhQoVMsODUolo1xHoeX22juhIktqBsJlhUI+251KEmh16qKy5jLSibCRYlSrulFg6x9hpfLXW7OeNALBoLyiOwKEXaUfVsJrPOTqsp5lsn01hQGIFFhnJrqRmjzEohrSbprXPILCiGwCJtBbVUSfTWcTQWlEFgkQ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m3ff30Z9rxnAP1vhdg11ZE+897kBCVQSwH4FFig4qrYmBWbzMWn6W0b8f0vfWffb7I5UAYrMHixSdtyP+ebnwnOS63cInp2CQUABpM8EiJ2uTK/HTQ6w6zZVzYgFkxASLnCQeTADQ8XQF0aw4xajxFUBWLBFCfDP9JK0AciSwIBWTL0oIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOTj/wGZVIJ92gsmjAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Visualize landmarks \n", + "img_landmark" + ] + }, + { + "cell_type": "markdown", + "id": "100fd501", + "metadata": {}, + "source": [ + "## 3- Explore the class works\n", + "\n", + " 1. Create the object Masks extraction : \n", + " During the creattion of the object everything will happened automatically. We will detail the different step that has happened under the hood. The image is imported from the input file, the image is then convert in to 11 masks corresponding to each traits then, we clean the masks and extract morphological info such as area, centroid, landmarks... then we calculate the different measurements we want.\n", + " 2. Import the image and Masks extraction\n", + " 3. Clean the mask\n", + " 4.\n", + " 5. " + ] + }, + { + "cell_type": "markdown", + "id": "493c71c2", + "metadata": {}, + "source": [ + "### 1- Masks extraction \n", + "\n", + " + Import the image : \n", + " + Function to convert the image.png in to a disctionnary with key = trait ('trunk', 'dorsal_fin'...)\n", + " masks = img_seg.mask\n", + " + Visualize the mask\n", + " \n" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "f9ce0bf1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is the list of the trait ['dorsal_fin', 'adipos_fin', 'caudal_fin', 'anal_fin', 'pelvic_fin', 'pectoral_fin', 'head', 'eye', 'caudal_fin_ray', 'alt_fin_ray', 'trunk']\n" + ] + } + ], + "source": [ + "# Convert the image.png the dictionnary of mask\n", + "# 1- use the variable \"mask\" which is created by the function \"img_seg.get_channels_mask()\"\n", + "masks_dict = img_seg.mask\n", + "\n", + "print(\"This is the list of the trait :\",list(masks_dict.keys()))" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "fccc32b4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACnCAYAAADqiRxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUFklEQVR4nO3dfXRU9Z3H8fd3ZkICieFBBQMJAp6IAhVE5EF3WytSkW2F1q3iI1q7VMWqtbsW2q2ntmuP1dbSs2qVaguWVhYfWtBaRWk9bUVUVFQeDM+V8KjIMxJI8t0/cjlNJZBJMpN75+bzOidn7vzmztxPePjk5jd37jV3R0RE4iURdgAREck8lbuISAyp3EVEYkjlLiISQyp3EZEYUrmLiMRQ1srdzEabWYWZrTKzydnajoiIHM6ycZy7mSWBFcAooBJ4HbjU3ZdlfGMiInKYbO25DwVWufsadz8AzALGZmlbIiLyCdkq9x7A+nr3K4MxERFpBaksva41MPZP8z9mNhGYCJAkeUYHirMURUQknnaz/UN3P76hx7JV7pVAWb37pcDG+iu4+zRgGkCxdfFhNjJLUURE4ulFf+LvR3osW9MyrwPlZtbbzNoB44G5WdqWiIh8Qlb23N292sxuBJ4HksAv3X1pNrYlIiKHy9a0DO7+LPBstl5fRESOTJ9QFRGJIZW7iEgMqdxFRGJI5S4iEkMqdxGRGFK5i4jEkMpdRCSGVO4iIjGkchcRiSGVu4hIDKncRURiSOUuIhJDKncRkRhSuYuIxJDKXUQkhlTuIiIxpHIXEYkhlbuISAyp3EVEYkjlLiISQyp3EZEYUrmLiMRQKuwAbU2ioABr356DA3qxbUABJU+/T3XlhrBjiUjMqNxbSaqslO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N+YlsnwNejnrOpn6FPS2TCxf2iOxFScysF3A6dXvFkcuZQxd5mQrcBtTWG4tiTgfmmdkbZjYxojn7AB8AvwqmuR42s8II5qxvPPBYsBzlnE0SdrmndWGPiAo1u5kVAU8Ct7j7rqOt2sBYq+T0LFzkJdPM7PPAVnd/I92nNDDWWn/vZ7v7YOACYJKZffoo64aVM0Xd1ObP3f106k4rcrT30sL+f9QOuBB4vLFVGxiLdFeFXe5pXdgjZC26KEk2mFkedcX+G3d/Kqo5D/EMXuQlC84GLjSzdcAs4FwzmxnBnLj7xuB2K/A76q5NHLWclUBl8FsawBPUlX3Uch5yAfCmu28J7kc1Z5OFXe6vA+Vm1jv4CTqeuot9REmkLkpiZgY8Aix393sjnDMnLvLi7lPcvdTde1H37+9P7n5F1HKaWaGZHXNombp54iVRy+num4H1ZtY3GBpJ3bUdIpWznkv5x5TMoTxRzNl0YU/6A2OoO+JjNfCdkLM8BmwCDlL3k/pa4Fjq3mxbGdx2qbf+d4LcFcAFrZTxX6j7dfAdYHHwNSaCOU8D3gpyLgFuD8YjlfMTmc/hH2+oRiondXPZbwdfSw/9X4lazmC7g4BFwd/974HOEc3ZAdgGdKw3Frmczf3SJ1RFRGIo7GkZERHJApW7iEgMqdxFRGJI5S4iEkMqdxGRGFK5i4jEkMpdRCSGVO4iIjH0/1xedi1qt9iKAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Visualize the mask for a specific trait\n", + "trait_name = 'head'\n", + "plt.imshow(masks_dict[trait_name])" + ] + }, + { + "cell_type": "markdown", + "id": "486170f3", + "metadata": {}, + "source": [ + "### 2- Clean the mask and presence matrix\n", + "\n", + "Clean the mask involve:\n", + " + Assessing the number of blob and decide what we keep and what we discard\n", + " + Filling up hole in the blob\n", + " + Create the presence matrix with Number of blob and the percentage of the biggest\n", + " \n", + "We will use the module skimage.measure.regionprops to manipulate the mask, find the individual blobs and access properties of the \"region\" (blob) such as centroid, area, bbox... (reference : https://scikit-image.org/docs/dev/api/skimage.measure.html)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b65c0131", + "metadata": {}, + "outputs": [], + "source": [ + "# Example of problem, the head trait mask as hole inisde correspond to the eye.\n", + "# we want the whole head especially if we want to calculate area\n" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "b92fee15", + "metadata": {}, + "outputs": [], + "source": [ + "# Create a regionprop that has been cleaned\n", + "# Remove hole \n", + "# Keep only the big blob\n", + "# regionprop_object has mutiple properties\n", + "regionprop_head = img_seg.clean_trait_region(masks_dict['head'])" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "be28ead1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "area : 16034\n", + "centroid : (148.13259323936634, 119.70369215417239)\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAgG0lEQVR4nO3deWBU5dXH8e+ZyQ6EAIGwE0A2WWVfKi8qFEEKuOOCWLG41O21VbG2r9a21taNtgoUKyK2ahFrRUUWq2gVZN9kDbtI2MKahIRk5nn/mAEDJJLM9tyZOZ9/wtyZuffkMr/cO3d5jhhjUErFH5ftApRSdmj4lYpTGn6l4pSGX6k4peFXKk5p+JWKU2ELv4hcLiKbRGSLiIwP13KUUoGRcJznFxE3sBkYBOwGlgI3GGPWh3xhSqmAhGvL3xPYYozZZow5CbwFjAjTspRSAUgI03wbAd+Uebwb6FXRi5Mk2aRQLUylqHgmyclc0OYQgpwxfX1uXRIOFFiqKrSOc/igMaZ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0nVypqDWh2O+8yulIstJW36lVARZD7+IXC4im0Rki4iMt12PLSKyQ0TWisgqEVnmn1ZbROaLSI7/Zy3bdYaLiEwVkf0i8nWZaRX+/iLyqP8zs0lEBtupOrwqWCdPiMi3/s/JKhEZWua5Kq0Tq+EXETfwEjAEuBC4QUQutFmTZZcYY7qUOX0zHviPMaYV8B//41g1Dbj8rGnl/v7+z8gooL3/PRP9n6VYM41z1wnAC/7PSRdjzGwIbJ3Y3vL3BLYYY7YZY04CbwEjLNfkJCOA1/z/fg0Yaa+U8DLGfA4cOmtyRb//COAtY0yxMWY7sAXfZymmVLBOKlLldWI7/I2Ab8o83u2fFo8MME9ElovIOP+0LGNMLoD/Zz1r1dlR0e8f75+be0Rkjf9rwamvQlVeJ7bDX96dGfF6+qGfMaYrvq9APxWR/rYLcrB4/txMAloCXYBc4Dn/9CqvE9vh3w00KfO4MbDHUi1WGWP2+H/uB97Ft8u2T0QaAPh/7rdXoRUV/f5x+7kxxuwzxniMMV7gZb7bta/yOrEd/qVAKxFpLiJJ+A5YzLJcU8SJSDURqXHq38APga/xrYsx/peNAd6zU6E1Ff3+s4BRIpIsIs2BVsASC/VF3Kk/hn5X4vucQADrxOotvcaYUhG5B5gLuIGpxph1NmuyJAt4V0TA93/yhjFmjogsBWaIyFhgF3CtxRrDSkTeBAYAmSKyG3gceJpyfn9jzDoRmQGsx9c056fGmOhrlnceFayTASLSBd8u/Q7gDghsnegVfkrFKdu7/UopSzT8SsUpDb9ScUrDr1Sc0vArFac0/ErFKQ2/UnFKw69UnPp/p9FEZdFiSVEAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Explore Regionprop_object properties\n", + "# full list of properties is here https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops\n", + "print(\"area :\", regionprop_head.area)\n", + "print(\"centroid :\", regionprop_head.centroid)\n", + "# display the image of the new mask correponding to the clean trait mask\n", + "plt.imshow(regionprop_head.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "f5eea310", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACKCAYAAABRuwqNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOe0lEQVR4nO3de3CV9Z3H8fc3MQESLga5NAu0RKHUy2zRMqjFui5oC2grbbcV29qMYxd3BVfEdQeG6bo7W2fcdRZ3xql2rdqiVVlXpbKOlSKy22mpXAVKDBEENFlCAspyCZfknHz3j/OkHsjJ/Zw8T558XjNnznN+58l5PlzyycnvPOf8zN0REZF4yQs7gIiIZJ/KXUQkhlTuIiIxpHIXEYkhlbuISAyp3EVEYihn5W5mM82sysz2mNniXB1HRERas1yc525m+cB7wA1ADbAJuNXd3836wUREpJVcPXOfCuxx973u3gisAG7O0bFEROQc5+XocccA1Wm3a4Ar29q50Ab4QIpzFEVEJJ6Oc+Swu4/MdF+uyt0yjJ01/2Nm84B5AAMp4kqbkaMoIiLx9Ka/9EFb9+VqWqYGGJd2eyxwIH0Hd3/C3ae4+5QCBuQohohI/5Srct8ETDSzMjMrBOYCq3J0LBEROUdOpmXcPWFmC4DVQD7wtLtX5OJYIiLSWq7m3HH314HXc/X4IiLSNr1DVUQkhlTuIiIxpHIXEYkhlbuISAyp3EVEYkjlLiISQyp3EZEYUrmLiMSQyl1EJIZU7iIiMaRyFxGJIZW7iEgM9eiDw8xsP3AcSAIJd59iZsOB/wDGA/uBb7v7kZ7FFBGRrsjGM/c/d/fJ7j4luL0YWOvuE4G1wW0REelFuZiWuRlYHmwvB+bk4BgiItKOnpa7A782sy3BmqgAo929FiC4HtXDY4iISBf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DI84Zi2LO5cAPgu1C4Pwo5kzLmw8cBD4T5Zxd/nOFenC4GliddnsJsCTkTOM5u9yrgNJguxSoypQVWA1cHULeV4EbopwTKAK2AldGMScwFlgLTE8r9yjmzFTukcoJDAX2EbyeF9Wc52T7MvC7qOfs6iXsaZkxQHXa7ZpgLEpGu3stQHA9KhgPPbuZjQcuJ/WsOHI5g6mObUA9sMbdI5kT+Dfg74DmtLEo5nTg12a2xczmRTTnhcAh4GfBNNeTZlYcwZzp5gIvBNtRztklYZe7ZRjrK6fvhJrdzAYDLwML3f1Ye7tmGOuVnO6edPfJpJ4ZTzWzy9rZPZScZnYTUO/uWzr7JRnGeuvffZq7XwHMAuab2bXt7BtWzvNITW0+7u6Xk/pYkfZeSwv7+6gQ+Brwnx3tmmEs0l0VdrnXAOPSbo8FDoSUpS11ZlYKEFzXB+OhZTezAlLF/py7vxLVnC3c/f+A/wZmEr2c04Cvmdl+YAUw3cx+EcGcuPuB4LoeWAlMjWDOGqAm+C0N4CVSZR+1nC1mAVvdvS64HdWcXRZ2uW8CJppZWfATdC6wKuRM51oFlAfb5aTmuFvG55rZADMrAyYCG3MdxswMeAqodPdlEc450szOD7YHAdcDu6KW092XuPtYdx9P6v/fW+7+vajlNLNiMxvSsk1qnnhn1HK6+0Gg2swmBUMzgHejljPNrXwyJdOSJ4o5uy7sSX9gNqkzPt4Hloac5QWgFmgi9ZP6DuACUi+27Q6uh6ftvzTIXQXM6qWM15D6dXAHsC24zI5gzj8F3gly7gT+PhiPVM5zMl/HJy+oRionqbns7cGlouV7JWo5g+NOBjYH//a/BEoimrMI+AgYljYWuZzdvegdqiIiMRT2tIyIiOSAyl1EJIZU7iIiMaRyFxGJIZW7iEgMqdxFRGJI5S4iEkMqdxGRGPp/FDdh7KZwHJoAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Example with other image with 2 pevilc fins\n", + "# load the test image, you can add more test image if you have bug related to specific images.\n", + "segmented_file = '../Test_Data/INHS_FISH_18609_segmented.png'\n", + "img_seg_2 = tc.segmented_image(segmented_file)\n", + "masks_dict_2 = img_seg_2.mask\n", + "plt.imshow(masks_dict_2['pelvic_fin'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "6bb2a90a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAADhCAYAAADRVO5tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOk0lEQVR4nO3df6zdd13H8eeLWlo2RFrYlrJOB0lBCIEOb8ZwxsyVaZlk85+ZzWD6x5L+g3EoCes0McGEZCaG4B/GpBGkEQQnP9yyEEctLEZDgAJldJStkx+jrK4wQKYkSwdv/zjfytnZ/XHur/P9fnqfj+Tke77fe849r55777vvvu/n+22qCklSe57TdwBJ0spYwCWpURZwSWqUBVySGmUBl6RGWcAlqVGrKuBJ9iZ5KMkjSQ6sVShJ0tKy0nXgSTYBDwPXAaeAzwO3VNVX1y6eJGkhP7eK514JPFJVXwdI8mHgRmDBAv7cbKmtXLiKl1zYy1/z43X5vLP08AMX9B1B0gA9yQ++V1UXTR5fTQG/FPj22P4p4PWLPWErF/L67FnFSy7svvuOrcvnnaXfesnuviNIGqB/rY98a77jqyngmefYs+YxSfYD+wG2YocpSWtlNb/EPAVcNra/E3hs8kFVdbCq5qpqbjNbVvFykqRxq+nAPw/sSvJS4DvAzcDvrUmqKdz32LFZvdTMrNefydGMdH5acQGvqqeT/AFwH7AJeF9VPbhmySRJi1pNB05VfQL4xBplkSQtg2diSlKjVtWBr6fzccbdl1m9l87apdmyA5ekRlnAJalRgxqhODZp20b4+jkm0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AVckhplAZekRv0f1OlppFqvNtEAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# During the clean step we remove the small blod and keep only the big one\n", + "regionprop_pelvic = img_seg.clean_trait_region(masks_dict_2['pelvic_fin'])\n", + "plt.imshow(regionprop_pelvic.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "03bf6f15", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'dorsal_fin': {'number': 1, 'percentage': 1.0}, 'adipos_fin': {'number': 0, 'percentage': 0}, 'caudal_fin': {'number': 1, 'percentage': 1.0}, 'anal_fin': {'number': 1, 'percentage': 1.0}, 'pelvic_fin': {'number': 2, 'percentage': 0.9156065777226187}, 'pectoral_fin': {'number': 1, 'percentage': 1.0}, 'head': {'number': 1, 'percentage': 1.0}, 'eye': {'number': 1, 'percentage': 1.0}, 'caudal_fin_ray': {'number': 0, 'percentage': 0}, 'alt_fin_ray': {'number': 0, 'percentage': 0}, 'trunk': {'number': 2, 'percentage': 0.9499680160833409}}\n" + ] + } + ], + "source": [ + "# The presence matrix is created using the following function\n", + "presence = img_seg_2.get_presence_matrix()\n", + "# or directly access the variable\n", + "presence = img_seg_2.presence_matrix\n", + "print(presence)" + ] + }, + { + "cell_type": "markdown", + "id": "4f2d1e48", + "metadata": {}, + "source": [ + "### 3- Collect properties and landmark\n", + "\n", + "In this section there are multiple small functions to calculate and extract what we want from the mask, using either direct calculation on the mask or using the regionprop_object. You can explore the class on the repo, there are plenty of small functions with some redundancy (with different way calculate the same value) and some that are not necessarly used and function in jupyter notebook (particular visualisation functions)\n", + "\n", + "List of funtion: \n", + "\n", + " + img_seg.landmark_generic(trait_name) : return the most front_point , back_point, top_point, bottom_point, centroid, new_mask\n", + " + img_seg.landmark_5_7 : calculate specifically the landmark 5 7\n", + " + img_seg.all_landmark() : combine all the landmark in a dictionnary\n", + " + img_seg.visualize_landmark() : plot landmark on the original segmentation\n", + " \n", + "Now play" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "b64417f6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "most front point: (148, 36)\n", + "most back point: (162, 187)\n" + ] + } + ], + "source": [ + "front_lm, back_lm, top_lm, bottom_lm, centroid, new_mask = img_seg.landmark_generic('head')\n", + "print(\"most front point:\", front_lm)\n", + "print(\"most back point:\", back_lm)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "8208aa2c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'1': (148, 36),\n", + " '2': (66, 148),\n", + " '3': (21, 301),\n", + " '4': (106, 566),\n", + " '5': (112, 606),\n", + " '6': (150, 622),\n", + " '7': (203, 592),\n", + " '8': (200, 562),\n", + " '9': (242, 478),\n", + " '10': (279, 305),\n", + " '11': (217, 169),\n", + " '12': (162, 187),\n", + " '13': (224, 138),\n", + " '14': (136, 66),\n", + " '15': (134, 96)}" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# landmark dictionnary\n", + "img_seg.all_landmark()" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "99b54f95", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAAY90lEQVR4nO3dbW6jyrqA0Tooo7gjPIOILGR5EFt7gGcUkXV/4KYJxhgwUF9rqdXqdBzHSbvtJ28VOAQAAAAAAAAAAAAAAEjEf2LfAKAW99n3NifdCoAzCCxgT/MVNU9jAcUQWMB2n+TUJI0FlEFgAUvtnlOTNBZQgK/YNwBI2jlRBVAYEyyoXYIJZYgF5E5gQUUSbKlXNBaQNYEFMbVtO/PmhzLKqUkaC8iXwII4Zlrqk8zKPaq2kWJAagQWnG1hPy3PrDqjaiHtBUQhsOBUq6ZTkxeWUzuSX8BBnKYBMiCqDjL6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4yPlclpOYwGRCCx2k0tjlRZYh+5qyp3AAiL5in0DKEcTmlwaK3uiCiBtAos9aaxPtF+//j+2Pz8TF5JWADkQWOxMY20wSqvhX/7NLGm1lvVBIB6Bxf6a0IR8tmTFNZlWzxdoL2XtGzuBugKi8hjEURr3rnfe1tXfSxpfLdQ0j18AUZlgcSDLhRxOSwFJcpoGDpdaYyVymobh+Kpt2/73yT883rRQ2BFVQPI8TnE4a4Uz2rYdV9QgtkbvqlG/5Df8BZA8D1WcQWON9OOr58Ca+6hidmJNZpOWAgpiDxYncWhhvXQSUB+Bxan6UZbSKpyoAurmQZA4+kWg8z/v+IWQ+ZClPYAnjiIkISeMtf4m3ff30Z9rxnAP1vhdg11ZE+897kBCVQSwH4FFig4qrYmBWbzMWn6W0b8f0vfWffb7I5UAYrMHixSdtyP+ebnwnOS63cInp2CQUABpM8EiJ2uTK/HTQ6w6zZVzYgFkxASLnCQeTADQ8XQF0aw4xajxFUBWLBFCfDP9JK0AciSwIBWTL0oIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOTj/wGZVIJ92gsmjAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Visualize the landmark\n", + "img_seg.visualize_landmark()" + ] + }, + { + "cell_type": "markdown", + "id": "bd018bc8", + "metadata": {}, + "source": [ + "### 3- Measurement part\n", + "\n", + "Functions to calculate what we need to measure what we want!!!\n", + "\n", + " + img_seg.get_distance(a,b) : measure distance between two point\n", + " + img_seg.measure_eye_area()\n", + " + img_seg.measure_head_area()\n", + " + img_seg.measure_eye_head_ratio()\n", + " + img_seg.calculate_triangle_area(point_1, Poit_2, point_3)\n", + " + img_seg.measure_eye_diameter()\n", + " + img_seg.all_measure() create the following dictionnary using the previous fucntions:\n", + " + measure['SL'] = self.get_distance(landmark['1'],landmark['6'])\n", + " + measure['EA'] = self.measure_eye_area()\n", + " + measure['HAt'] = self.calculate_triangle_area(landmark['1'],landmark['2'],landmark['13'])\n", + " + measure['HAp'] = self.measure_head_area()\n", + " + measure['HCL'] = \"WIP\"\n", + " + measure['ED'] = self.measure_eye_diameter()\n", + " + measure['HL'] = self.get_distance(landmark['1'],landmark['12'])\n", + " + measure['HD'] = self.get_distance(landmark['2'],landmark['13'])\n", + " + measure['pOD'] = self.get_distance(landmark['1'],landmark['14'])\n", + "\n", + "Now play!" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "f4bf0c4f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'SL': 586.0034129593445,\n", + " 'EA': 922,\n", + " 'HAt': 8437.999999999995,\n", + " 'HAp': 16034,\n", + " 'HCL': 'WIP',\n", + " 'ED': 34.262616074167774,\n", + " 'HL': 151.64761785138597,\n", + " 'HD': 158.3161394173064,\n", + " 'pOD': 32.31098884280702}" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "img_seg.all_measure()" + ] + }, + { + "cell_type": "markdown", + "id": "e033c2f9", + "metadata": {}, + "source": [ + "## Development Section\n", + "\n", + "This is where we make a mess!!!" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "add5f243", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "82724" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADdCAYAAABAMDLCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAjm0lEQVR4nO3deXxU1f3/8ddnJiEhJCJhM7LIIrsiUkRApbjT0srXtu4IrrgrVu1Pba1+W7Xu4lJABBHr/lXrvoALKhhEEJAdAoQ1g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svJlP2J/BMwJ/TzW7WNA+gOzA61zXzg76HyuG+bcr/vAH6ZLROX7aInVEVEYpDXwzIiIhIGSu4iIjFIyV1EJAYpuYuIxCAldxGRGKTkLiISg5TcRURikJK7iEgM+v94zGEOtozB3AAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "trunk_pro = img_seg.clean_trait_region(masks['trunk'])\n", + "trunk_mask = trunk_pro.image\n", + "pad_mask =np.pad(trunk_mask, ((1, 1), (1,1)), 'constant', constant_values=((0, 0),(0,0)))\n", + "list_contour = ski.measure.find_contours(trunk_mask)\n", + "erosion_trunk = ski.morphology.erosion(pad_mask)\n", + "plt.imshow(pad_mask)\n", + "np.all(pad_mask == erosion_trunk)\n", + "sum(sum(pad_mask))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "982c2856", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "d452f502", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(264, 474)\n", + "(262, 472)\n", + "1277.9453095790602\n", + "1277.9453095790602\n" + ] + } + ], + "source": [ + "print(pad_mask.shape)\n", + "print( trunk_mask.shape)\n", + "print(ski.measure.perimeter(trunk_mask))\n", + "print(ski.measure.perimeter(pad_mask))" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "5d3ae5d3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n", + "1427\n", + "(1495, 2)\n", + "1128\n", + "125136\n" + ] + } + ], + "source": [ + "contour_1 = ski.measure.find_contours(trunk_mask)\n", + "print(len(contour_1))\n", + "print(sum([a.shape[0] for a in contour_1]))\n", + "\n", + "contour_2 = ski.measure.find_contours(pad_mask)[0]\n", + "print(contour_2.shape)\n", + "\n", + "contour_ = np.logical_and(pad_mask, np.logical_not(erosion_trunk))\n", + "print(sum(sum(contour_)))\n", + "contour_3 = ski.measure.find_contours(contour_)[0]\n", + "print(sum([a.shape[0] for a in contour_]))" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "id": "ee1e920f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[array([[262.5, 145. ],\n", + " [262.5, 144. ],\n", + " [262.5, 143. ],\n", + " ...,\n", + " [261.5, 146. ],\n", + " [262. , 145.5],\n", + " [262.5, 145. ]])]" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADdCAYAAABAMDLCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAooElEQVR4nO3deXhdVbn48e97hpyTpEmapJmTJmmbNG0RWiilBQdGBURBH+FWfyoIV8SrV1EEQcABRFFkUK+gVbiCIsgVB0BECloc2tKJFtqmmZo0c9Kmmeezz/r9cU4hpUmTZtpneD/Pk+ecs/ba+7xZ4tuVtddeS4wxKKWUiiwOuwNQSik1/TS5K6VUBNLkrpRSEUiTu1JKRSBN7kopFYE0uSulVASaseQuIheKSJmIVIrIzTP1PUoppY4lMzHPXUScQDlwAVAPbAU+aozZO+1fppRS6hgz1XNfBVQaY/YbY4aAJ4FLZ+i7lFJKvY1rhq6bA9SN+FwPnDFW5RjxGC/xMxSKmgx/cjxGRj8mfoOjo292A1JKHaOb9kPGmLTRjs1Uch8tLRw1/iMi1wLXAniJ4ww5b4ZCUSNV3bsakzE4bj3PvljEGv2Y3wNDi/qPKU/7i4ekxzdPNUSl1AS9ZH53YKxjM5Xc64G8EZ9zgcaRFYwx64B1AImSogvcTJJ4PPhPLRlRAO1f6ycroWvU+vPvHMZb1338ixqDVfk6+EfP7uKOwbFg/jHlNR+JJf2VTADqnyhk3q7Re/eu/U1YLa3Hj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YzqADcCFaNucBXxQRGoIDPGeKyK/Jkrbxe7kvhUoEpFCEYkB1hLYgzXaPQNcGXx/JfCnEeVRsT/tWHv3om2DiKSJyNzg+1jgfGAfUd42xphbjDG5xpgCArnkb8aYjxOt7WL3HV3gYgIzIaqAW+2Ox4bf/wmgCRgm0JO4BkgFXgYqgq8pI+rfGmyrMuAiu+OfwXZ5J4E/kV8HdgZ/Lta2MQAnA68F22Y38PVgedS3zYjf92zemi0Tle2iT6gqpVQEsntYRiml1AzQ5K6UUhFIk7tSSkUgTe5KKRWBNLkrpVQE0uSulFIRSJO7UkpFIE3uSikVgf4/w2y4BiGfKVsAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "contour_ = np.logical_and(pad_mask, np.logical_not(erosion_trunk))\n", + "plt.imshow(contour_)\n", + "list_contour = ski.measure.find_contours(contour_)\n", + "list_contour_2 = ski.measure.find_contours(pad_mask)\n", + "list_contour_2\n" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "id": "f5abdcdd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1495, 2)" + ] + }, + "execution_count": 88, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a =list_contour_2[0]\n", + "a.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "id": "a7e0885b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1280.7737367037953" + ] + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "distance = lambda a,b: ((a[0] - b[0])**2 + (a[1] - b[1])**2)**0.5\n", + "distance(list_contour_2[0][0,:],list_contour_2[0][1,:])\n", + "a =list_contour_2[0]\n", + "list_segment = [distance(a[i,:],a[i+1,:]) for i in range(a.shape[0]-1)]\n", + "sum(list_segment)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "84e350d9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADcCAYAAACLbOFnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAjRklEQVR4nO3dd3xUVd7H8c9vJiEhRKoUKdKLoC4CAtaH1bWsDXdtuKxiAxV1RX3s7uPqa3XXvjZcUVx1dXWxIepaEGUVqUFAhVBCUYKhKEFJQpIp5/kjAwZJI5nJnfJ9v155zcyZO/f+OMo3l3PvnGPOOUREJLn4vC5ARESiT+EuIpKEFO4iIklI4S4ikoQU7iIiSUjhLiKShGIW7mZ2opmtMLM8M7spVscREZE9WSzuczczP7ASOA7IBxYA5zrnlkX9YCIisodYnbkPBfKcc2ucc+XAy8DIGB1LRER+Ji1G++0ErK/0Oh8YVnkDMxsHjAPw4x+cRfMYlSI7md9PsEVmrduFMuDAtluqfX9laQtC3zXZoz1tezkuEGhQjSJSd9sp/M4517aq92IV7lZF227jP865ScAkgObW2g2zY2NUSmrxDezPimurDvB9mu9gydCX6rinLnt97F8uPYevC9oA0O+69YS2VP8LQkQa7kP36tfVvRercM9n93ToDHwbo2OlFp8fG3QAWMXvz5UXZPHg8S/uerut/3OOyPTmJqiPB7wJAyqefzAnnRKXUeV2f7nzPFotL9qtzb5cRbi0NNYliqSMWIX7AqC3mXUHNgCjgN/F6FhJKXjMYPKP2XPoI9TUsWLURPxWXYDHx92tx2cFgKqHaE6/54k92rq/NZYmW3b/37Hnw3k6+xepp5iEu3MuaGZXAu8DfuAZ59zSWBwrUVlaGr4WFdcZNp7dlwPP3717Tmg9ldH7fF/Np+MjwKNp7alP7dF23a8HsaW8oo8+XdyPA27L2/Ve+IcfccFgo9Unkmhicivk3kr2Mfe0Du3ZfFKP3dq29YV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dUrK/qljisdpNq2hL2v5xFSuhDaRitbOhZnZgDZunRN+Y2SnAZufcwrp+pIq2pOgXr8NdS/JVbdPOla4ij5sj7SnXX1Ut8Yj6ZzfOuW3ATOBE1DdHAKeZ2ToqhnmPMbMXSMF+8TrcFwC9zay7mTUBRlGxTF+qmwaMiTwfA7xZqT1lljCsbolH1D+YWVszaxl53hT4FbCcFO8b59zNzrnOzrluVOTJR86535OK/eL1FV3gJCruglgN3Op1PR78+V8CCoAAFWcRFwNtgBnAqshj60rb3xrpqxXAr72uP8Z9cyQV/0T+Algc+TlJ/eMADgYWRfrmK+D/Iu0p3zeV/rwj+OlumZTrF00/ICKShLwelhERkRhQuIuIJCGFu4hIElK4i4gkIYW7iEgSUriLiCQhhbuISBL6fwONMOKw0iCYAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(trunk_pro.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "6ee0446b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACnCAYAAADqiRxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAbaklEQVR4nO3deXxU5b3H8c9vJhtJWELCEsIWMGwqRVkEba2iFkQRRalYrV6roqi1aqsFW73dr7ZqaS2gVFFcETdARSlEvFwBwbATIJAQTEI29pB9luf+kUEChCxkJufM5Pd+vfKamTMnM98Q8s3Jc855jhhjUEopFVocVgdQSinlf1ruSikVgrTclVIqBGm5K6VUCNJyV0qpEKTlrpRSIShg5S4iY0UkQ0QyRWRaoN5HKaXU6SQQx7mLiBPYBVwF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LWcekOf7Kw3gfWrK3m45j7sa2GCMKfI9tmvOJrO63L8BUkQk2fcbdDI1F/uwE1tdlEREBHgF2GGMed7GOYPiIi/GmOnGmO7GmN7U/P/7whhzm91yikiMiLQ9fp+aceJtdstpjCkEckWkv2/RFdRc28FWOWu5hRNDMsfz2DFn01k96A+Mo+aIjyzgNxZneQcoAFzU/Ka+C4inZmfbbt9tx1rr/8aXOwO4uoUyfp+aPwe3AJt8H+NsmHMwsNGXcxvwlG+5rXKekvkyTuxQtVVOasayN/s+0o//rNgtp+99hwBpvu/9QiDOpjmjgYNA+1rLbJfzbD/0DFWllApBVg/LKKWUCgAtd6WUCkFa7kopFYK03JVSKgRpuSulVAjScldKqRCk5a6UUiFIy10ppULQ/wPc4J223O+wUQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "caudal_fin = img_seg.mask['trunk']\n", + "\n", + "plt.imshow(caudal_fin)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "cf78ee7e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACnCAYAAADqiRxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAU0UlEQVR4nO3deXhU9b3H8fd3JhshBBI2MSBgDCBwRZQCiqVc0IrWq17qVmtr+2BxgdbtaYsPelvb5/ZRW21t3YpLS90oole81qtV1Pq0bKJIFREEsRLZAiJhkZBMvvePnLQBAklgJufk+Hk9zzw585szcz5h+eTkN2fOMXdHRETiJRF2ABERST+Vu4hIDKncRURiSOUuIhJDKncRkRhSuYuIxFDGyt3MxpvZCjNbZWZT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Zh8CM4GxZvZIBHPi7uuCr5uA/6Hu2sRRy1kOlAe/pQHMpq7so5az3hnAm+6+Mbgf1ZwtFna5vw6UmVnf4CfoRdRd7CNKInVREjMz4EFgubvfEeGcbeIiL+5+g7v3dPc+1P37e9ndL4laTjNrb2Yd6pepmyd+J2o53X0DsNbM+gdD46i7tkOkcjbwNf41JVOfJ4o5Wy7sSX/gTOqO+FgNTAs5y+PAeqCaup/UE4HO1L3Z9n7wtbjB+tOC3CuAM1op4ynU/Tr4d+Ct4HZmBHMeBywJcr4D/FcwHqmc+2Qew7/eUI1UTurmspcGt2X1/1eiljPY7vHA4uDv/mmgKKI584EtQMcGY5HLeag3fUJVRCSGwp6WERGRDFC5i4jEkMpdRCSGVO4iIjGkchcRiSGVu4hIDKncRURiSOUuIhJD/w9U4+5xjrcEOgAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(img_seg.mask['caudal_fin'])" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "cb94b95f", + "metadata": {}, + "outputs": [], + "source": [ + "_,_,_,_,center_caudal,new_mask_caudal= img_seg.landmark_generic('caudal_fin')\n", + "\n", + "row_caudal = round(center_caudal[0])\n", + "head_horil_line = new_mask_caudal[row_caudal, :]\n", + "#head_length = np.count_nonzero( cleaned_mask[:,col_eye]== 1)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "ed0dc8c6", + "metadata": {}, + "outputs": [], + "source": [ + "def landmark_5_7(img_seg):\n", + " '''\n", + " locate the landmark 5 and 7 of the caudal fin. \n", + " We split the caudal fin upper and lower part (horizontal line through the middle).\n", + " Then, in each case get the mot left point in the half of the caudal fin\n", + " '''\n", + " _,_,_,_,center_caudal,new_mask_caudal= img_seg.landmark_generic('caudal_fin')\n", + " mask_caudal_5 = new_mask_caudal.copy()\n", + " mask_caudal_7 = new_mask_caudal.copy()\n", + " row_caudal = round(center_caudal[0])\n", + "\n", + " mask_caudal_5[row_caudal:,:] = 0\n", + " mask_caudal_7[:row_caudal,:] = 0\n", + " \n", + " lm_5_7=[]\n", + " for temp_mask in [mask_caudal_5,mask_caudal_7]: \n", + " x,y = np.where(temp_mask)\n", + " y_front = y.min()\n", + " x_front = round(np.mean(np.where(temp_mask[:, y_front,])))\n", + " lm_5_7.append((int(x_front),int(y_front)))\n", + " return lm_5_7[0], lm_5_7[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "id": "04909223", + "metadata": {}, + "outputs": [], + "source": [ + "lm_5, lm_7 = landmark_5_7(img_seg)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "f519df18", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAATkUlEQVR4nO3d4W7juBWAUVaYh+1DBIvBwA9R9FkLoz+UcZzEdmSZIu8lz8H+6W4mkR3V/OaKlksBAAAAAAAAAAAAAIAg/tX7AIBZnB/+16XRUQC0ILCAmh5X1GMaCxiGwAL2eyWnbtJYwBgEFrBV9Zy6SWMBA/jV+wCA0NpEFcBgTLBgdgETyhALyE5gwUQCttQ9GgtITWDBsBLl1E0aC8hLYMFQskfVPlIMiEZgQXpzRtVG2gvoQmBBMnKqIvkFHERgQQKiqg29BdQisCA0adWF0gJeJLAgLnXVndIC9hFYEI6uikxyAVsILAhBVGUktoB7BBb0p65Sk1nAdwILGnp7e/zfz6dTmwPhCEoLuBBY8LKfsul1wisdsQWTE1iwwfEJtZ3YSkdswYQEFnwTKaeeJb8iU1owD4EFuYtqC9UVkNiCsQkspjF6RT1LdQWhtGBIAosRaakdTid3i+hFY8F4BBajEFVVmW81prFgMAKLhLRUc3qrDZkFwxBYxKalQtJbx9FYMAaBRQxCKjnJVZ3SgtQEFv2IqhEprbpkFiQlsGhLVE1DaVUksyAdgcXxRNX0xNbrNBbkIrA4krTiM6X1IpkFWQgsDqCr+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nsFYyiz2kFXAYgcVO0RprpbT4gagCmhBY7BQzsC6UFl9JK6AhgcV+wRuryCxEFdCJwGK/+IG1klkDUk5AbAKLl2RprCKz4tNMwEAEFq/SWDzhz58Dv/myHPjNAZ4hsHhVosAqGquB06mcA5wSYgvoSmBRgcaaVJCWukdjAf0ILOpI1FhTBNaX/UzfM+jH+IhcTttpLKATgUU1WRprtMA6dFdTdgIL6ORX7wNgHEtZsjRWeqIKIDaBRU0a63DSCiADgUVlGuso0upZrg8C/Qgs6lvKUvJsyQpNVO2mroCuBBZHMcp6lbraQVcBMQgsDqSx9lNXGykqICSBxbE01h7q6jFRBYQnsDicxmI/LQXkJLBoQWPxiWwCRiewaMRbC+clp4D5CCyaWjOrKK0HxtiAJaqAufksQjprXFrvhff21vKHbnX5hOZcH7SspQC+EVgE0iC2LiO0cI11qatrLUtLJwHUI7CI6KDS+qiriwiZdTOtHnscXlIJoDeBRVzVM+tGYH3XJrl2RBUAeQgsMnk2uTYVFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvf0f0gAfwXBLQAYAAAAASUVORK5CYII=\n", + "text/plain": [ + "" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "img_arr = img_seg.img_arr\n", + "def visualize_landmark(img_arr,coord):\n", + " text = '5' \n", + " \n", + " img = Image.fromarray(img_arr)\n", + " img1 = ImageDraw.Draw(img)\n", + " \n", + " #\n", + " #fnt = ImageFont.truetype(\"Pillow/Tests/fonts/FreeMono.ttf\", 15)\n", + " fnt = ImageFont.load_default()\n", + "\n", + " x,y = coord\n", + " xy = [(y-9,x-9),(y+9,x+9)]\n", + " img1.ellipse(xy, fill='gray', outline=None, width=1)\n", + " \n", + " img1.text((y-6, x-6), text, font=fnt, fill='black')\n", + " # Display the image created\n", + " \n", + " return img\n", + " \n", + "visualize_landmark(img_arr,lm_7)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python (Morphology_env)", + "language": "python", + "name": "snakemake" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Scripts/Morphology_dev.ipynb b/Scripts/Morphology_dev.ipynb index bf342e3..87e6a5a 100644 --- a/Scripts/Morphology_dev.ipynb +++ b/Scripts/Morphology_dev.ipynb @@ -7,28 +7,31 @@ "source": [ "# Development for morphology trait extraction\n", "\n", - "This notebook gives example and a platform to develop and visualize extraction on morphological traits\n", - "The function framework is based on a class \"Traits_class\" define in the same folder.\n", - "if you modify the \"Traits_class\" reload the module by running the first cell to see the modification appear in the notebook.\n", + "This notebook gives examples and a platform to develop and visualize extraction on morphological traits\n", + "The functions used are define in a class \"Traits_class\" that you can find in the same folder (Morphology-analysis/Scripts/Traits_class.py).\n", + "If you want modify the \"Traits_class.py\" reload the module by running the first cell to see the modification appear in the notebook.\n", "\n", "**Study case:**\n", + "To illustrate the morphology workflow and functionality, we are using the 2 images :\n", "\n", - "\n" + " + Morphology-analysis/Test_Data/INHS_FISH_000742_segmented.png\n", + " + Morphology-analysis/Test_Data/INHS_FISH_18609_segmented.png\n", + " " ] }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 35, "id": "602dc370", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 43, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -40,25 +43,27 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from PIL import Image, ImageDraw, ImageFont\n", + "from IPython.display import Image\n", "import importlib\n", + "import skimage as ski\n", "importlib.reload(tc)" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 2, "id": "e620246b", "metadata": {}, "outputs": [], "source": [ "# load the test image, you can add more test image if you have bug related to specific images.\n", - "segmented_file = 'test_images/INHS_FISH_000742_segmented.png'\n", - "metadata_file = 'test_images/INHS_FISH_000742.json'" + "segmented_file = '../Test_Data/INHS_FISH_000742_segmented.png'\n", + "metadata_file = '../Test_Data/INHS_FISH_000742.json'" ] }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 3, "id": "2289de98", "metadata": {}, "outputs": [], @@ -66,7 +71,7 @@ "# Create the object segmented image create by the class during initialisation\n", "img_seg = tc.segmented_image(segmented_file)\n", "\n", - "# variable create at initialization time\n", + "# oupput the variables create at initialization time\n", "measurement = img_seg.measurement\n", "landmark = img_seg.landmark\n", "presence_matrix = img_seg.presence_matrix\n", @@ -88,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 4, "id": "ae9eb407", "metadata": {}, "outputs": [ @@ -108,7 +113,7 @@ " 'trunk': {'number': 2, 'percentage': 0.992120507069956}}" ] }, - "execution_count": 21, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -120,7 +125,37 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 5, + "id": "b24d03d1", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'SL': 586.0034129593445,\n", + " 'EA': 922,\n", + " 'HAt': 8437.999999999995,\n", + " 'HAp': 16034,\n", + " 'HCL': 'WIP',\n", + " 'ED': 34.262616074167774,\n", + " 'HL': 151.64761785138597,\n", + " 'HD': 158.3161394173064,\n", + " 'pOD': 32.31098884280702}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# measurement dictionnary\n", + "measurement" + ] + }, + { + "cell_type": "code", + "execution_count": 6, "id": "ffda5440", "metadata": {}, "outputs": [ @@ -141,13 +176,10 @@ " '12': (162, 187),\n", " '13': (224, 138),\n", " '14': (136, 66),\n", - " '15': (134, 96),\n", - " '16': (115, 81),\n", - " '17': (153, 81),\n", - " '18': (135, 81)}" + " '15': (134, 96)}" ] }, - "execution_count": 45, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -159,73 +191,707 @@ }, { "cell_type": "code", - "execution_count": 29, - "id": "60024ce2", + "execution_count": 7, + "id": "8b7d1b1a", "metadata": {}, "outputs": [ { - "ename": "SyntaxError", - "evalue": "invalid syntax (1558273965.py, line 1)", - "output_type": "error", - "traceback": [ - "\u001b[0;36m Input \u001b[0;32mIn [29]\u001b[0;36m\u001b[0m\n\u001b[0;31m list_order = [1:19]\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAAY90lEQVR4nO3dbW6jyrqA0Tooo7gjPIOILGR5EFt7gGcUkXV/4KYJxhgwUF9rqdXqdBzHSbvtJ28VOAQAAAAAAAAAAAAAAEjEf2LfAKAW99n3NifdCoAzCCxgT/MVNU9jAcUQWMB2n+TUJI0FlEFgAUvtnlOTNBZQgK/YNwBI2jlRBVAYEyyoXYIJZYgF5E5gQUUSbKlXNBaQNYEFMbVtO/PmhzLKqUkaC8iXwII4Zlrqk8zKPaq2kWJAagQWnG1hPy3PrDqjaiHtBUQhsOBUq6ZTkxeWUzuSX8BBnKYBMiCqDjL6xuotYC8mWHCefiL1/IdXLrtue2chpQV8yMMInK2LquHvpOb+5xfANiZYcJLnllrYWIZYSfFTKbCEPVgQwfIlQlIzHGuJLeAVjw8QQdu2lggLYBkReMUEC84mrQrTN5YfWIGePVjwse/vJZdqv/7+PLNqibD9+bnfbltuGPGILaicwIIFliXUW8PGWvohPz+jvxFb2RFbUCFLhPBkp5w6SDN78+RXgqwhQoVMsODUolo1xHoeX22juhIktqBsJlhUI+251KEmh16qKy5jLSibCRYlSrulFg6x9hpfLXW7OeNALBoLyiOwKEXaUfVsJrPOTqsp5lsn01hQGIFFhnJrqRmjzEohrSbprXPILCiGwCJtBbVUSfTWcTQWlEFg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f4m3ff30Z9rxnAP1vhdg11ZE+897kBCVQSwH4FFig4qrYmBWbzMWn6W0b8f0vfWffb7I5UAYrMHixSdtyP+ebnwnOS63cInp2CQUABpM8EiJ2uTK/HTQ6w6zZVzYgFkxASLnCQeTADQ8XQF0aw4xajxFUBWLBFCfDP9JK0AciSwIBWTL0oIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOTj/wGZVIJ92gsmjAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Visualize landmarks \n", + "img_landmark" + ] + }, + { + "cell_type": "markdown", + "id": "100fd501", + "metadata": {}, + "source": [ + "## 3- Explore the class works\n", + "\n", + " 1. Create the object Masks extraction : \n", + " During the creattion of the object everything will happened automatically. We will detail the different step that has happened under the hood. The image is imported from the input file, the image is then convert in to 11 masks corresponding to each traits then, we clean the masks and extract morphological info such as area, centroid, landmarks... then we calculate the different measurements we want.\n", + " 2. Import the image and Masks extraction\n", + " 3. Clean the mask\n", + " 4.\n", + " 5. " + ] + }, + { + "cell_type": "markdown", + "id": "493c71c2", + "metadata": {}, + "source": [ + "### 1- Masks extraction \n", + "\n", + " + Import the image : \n", + " + Function to convert the image.png in to a disctionnary with key = trait ('trunk', 'dorsal_fin'...)\n", + " masks = img_seg.mask\n", + " + Visualize the mask\n", + " \n" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "f9ce0bf1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is the list of the trait ['dorsal_fin', 'adipos_fin', 'caudal_fin', 'anal_fin', 'pelvic_fin', 'pectoral_fin', 'head', 'eye', 'caudal_fin_ray', 'alt_fin_ray', 'trunk']\n" ] } ], "source": [ - "list_order = [1:19]" + "# Convert the image.png the dictionnary of mask\n", + "# 1- use the variable \"mask\" which is created by the function \"img_seg.get_channels_mask()\"\n", + "masks_dict = img_seg.mask\n", + "\n", + "print(\"This is the list of the trait :\",list(masks_dict.keys()))" ] }, { "cell_type": "code", - "execution_count": 46, - "id": "8b7d1b1a", + "execution_count": 17, + "id": "fccc32b4", "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAAZo0lEQVR4nO3dbW6bXBqA4TOoq5gVziIiC1lexGgW+K4isuYHKSGACWDgfF2XqqpJ7ISmrn3nOcc4BAAAAAAAAAAAAAAASMS/Yh8AUIvn4kebi44C4AoCCzjSckUt01hAMQQWsN87OTVLYwFlEFjAWofn1CyNBRTgT+wDAJJ2TVQBFMYEC2qXYEIZYgG5E1hQkQRb6hWNBWRNYEFMbdsuvPmmjHJqlsYC8iWwII6Flnons3KPqn2kGJAagQVXW9lP6zOrzqhaSXsBUQgsuNSm6dTsheXUgeQXcBKnaYAMiKqTjL6xegs4igkWXKefSE3/8Mrt0G3vrKS0gDe5G4GrdVE1/J3UPP/+AtjHBAsuMm2plY1liJUUP5UCa9iDBRGsXyIkNcOxltgCXnH/ABG0bWuJsACWEYFXTLDgatKqMH1j+YEV6NmDBW/7+FhzqfbP988zm5YI28/P5+Ox58CIR2xB5QQWrLAuoX41bKy1V/n8HL1HbGVHbEGFLBHCxEE5dZJm8fDkV4KsIUKFTLDg0qLaNMSajq/2UV0JEltQNhMsqpH2XOpUs0Mv1RWXsRaUzQSLEqXdUiuHWEeNr9Z6PJxxIBaNBeURWJQi7aiaWsisq9NqjvnWxTQWFEZgkaHcWmrBKLNSSKtZeusaMguKIbBIW0EtVRK9dR6NBWUQWKRBSGVOch1OaUHWBBbxiKoSKa1jySzIlMDiWqKqGkrrQDILsiOwOJ+oqp7Yep/GgrwILM4krfhJab1JZkEuBBYn0FX8ynlN99JYkAWBxUFEFbuJre1kFiROYPEeXcVRZNZ2MguSJbDYS1pxhscjDF4ImV9pLEiTwGI7acU1zLRWk1mQG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s9Z10Hx9nf60Fwz1Y4w8NdmXNfPS8JxKqIoDjCCxSdFJpzQzM4mXW+rOMfl+l763n4vdHKgHEZg8WKbpuR/x0ufCa5Ho8wjunYJBQAGkzwSInW5Mr8dNDbDrNlXNiAWTEBIucJB5MANDxcAXRbDjFqPEVQFYsEUJ8C/0krQByJLAgFbMvSggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5OP/SIFCPeO9YoQAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "" ] }, - "execution_count": 46, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACnCAYAAADqiRxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAUFklEQVR4nO3dfXRU9Z3H8fd3ZkICieFBBQMJAp6IAhVE5EF3WytSkW2F1q3iI1q7VMWqtbsW2q2ntmuP1dbSs2qVaguWVhYfWtBaRWk9bUVUVFQeDM+V8KjIMxJI8t0/cjlNJZBJMpN75+bzOidn7vzmztxPePjk5jd37jV3R0RE4iURdgAREck8lbuISAyp3EVEYkjlLiISQyp3EZEYUrmLiMRQ1srdzEabWYWZrTKzydnajoiIHM6ycZy7mSWBFcAooBJ4HbjU3ZdlfGMiInKYbO25DwVWufsadz8AzALGZmlbIiLyCdkq9x7A+nr3K4MxERFpBaksva41MPZP8z9mNhGYCJAkeUYHirMURUQknnaz/UN3P76hx7JV7pVAWb37pcDG+iu4+zRgGkCxdfFhNjJLUURE4ulFf+LvR3osW9MyrwPlZtbbzNoB44G5WdqWiIh8Qlb23N292sxuBJ4HksAv3X1pNrYlIiKHy9a0DO7+LPBstl5fRESOTJ9QFRGJIZW7iEgMqdxFRGJI5S4iE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8cAK4IsUctpQFGwnAe8CgyPWs56eW8Ffgs8E8W/92Db64DjPjEWxZwzgK8Gy+2ATlHMWS9vEtgMnBjlnE3+vkLdOIwAnq93fwowJeRMvfjncq8ASoLlEqCioazA88CIEPLOAUZFOSfQAXgTGBbFnNSduXQ+cG69co9izobKPVI5gWJgLcH7eVHN+YlsnwNejnrOpn6FPS2TCxf2iOxFScysF3A6dXvFkcuZQxd5mQrcBtTWG4tiTgfmmdkbZjYxojn7AB8AvwqmuR42s8II5qxvPPBYsBzlnE0SdrmndWGPiAo1u5kVAU8Ct7j7rqOt2sBYq+T0LFzkJdPM7PPAVnd/I92nNDDWWn/vZ7v7YOACYJKZffoo64aVM0Xd1ObP3f106k4rcrT30sL+f9QOuBB4vLFVGxiLdFeFXe5pXdgjZC26KEk2mFkedcX+G3d/Kqo5D/EMXuQlC84GLjSzdcAs4FwzmxnBnLj7xuB2K/A76q5NHLWclUBl8FsawBPUlX3Uch5yAfCmu28J7kc1Z5OFXe6vA+Vm1jv4CTqeuot9REmkLkpiZgY8Aix393sjnDMnLvLi7lPcvdTde1H37+9P7n5F1HKaWaGZHXNombp54iVRy+num4H1ZtY3GBpJ3bUdIpWznkv5x5TMoTxRzNl0YU/6A2OoO+JjNfCdkLM8BmwCDlL3k/pa4Fjq3mxbGdx2qbf+d4LcFcAFrZTxX6j7dfAdYHHwNSaCOU8D3gpyLgFuD8YjlfMTmc/hH2+oRiondXPZbwdfSw/9X4lazmC7g4BFwd/974HOEc3ZAdgGdKw3Frmczf3SJ1RFRGIo7GkZERHJApW7iEgMqdxFRGJI5S4iEkMqdxGRGFK5i4jEkMpdRCSGVO4iIjH0/1xedi1qt9iKAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" } ], "source": [ - "# Visualize landmarks \n", - "img_landmark" + "# Visualize the mask for a specific trait\n", + "trait_name = 'head'\n", + "plt.imshow(masks_dict[trait_name])" + ] + }, + { + "cell_type": "markdown", + "id": "486170f3", + "metadata": {}, + "source": [ + "### 2- Clean the mask and presence matrix\n", + "\n", + "Clean the mask involve:\n", + " + Assessing the number of blob and decide what we keep and what we discard\n", + " + Filling up hole in the blob\n", + " + Create the presence matrix with Number of blob and the percentage of the biggest\n", + " \n", + "We will use the module skimage.measure.regionprops to manipulate the mask, find the individual blobs and access properties of the \"region\" (blob) such as centroid, area, bbox... (reference : https://scikit-image.org/docs/dev/api/skimage.measure.html)" ] }, { "cell_type": "code", "execution_count": null, + "id": "b65c0131", + "metadata": {}, + "outputs": [], + "source": [ + "# Example of problem, the head trait mask as hole inisde correspond to the eye.\n", + "# we want the whole head especially if we want to calculate area\n" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "b92fee15", + "metadata": {}, + "outputs": [], + "source": [ + "# Create a regionprop that has been cleaned\n", + "# Remove hole \n", + "# Keep only the big blob\n", + "# regionprop_object has mutiple properties\n", + "regionprop_head = img_seg.clean_trait_region(masks_dict['head'])" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "be28ead1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "area : 16034\n", + "centroid : (148.13259323936634, 119.70369215417239)\n" + ] + }, + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAgG0lEQVR4nO3deWBU5dXH8e+ZyQ6EAIGwE0A2WWVfKi8qFEEKuOOCWLG41O21VbG2r9a21taNtgoUKyK2ahFrRUUWq2gVZN9kDbtI2MKahIRk5nn/mAEDJJLM9tyZOZ9/wtyZuffkMr/cO3d5jhhjUErFH5ftAp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+ }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Explore Regionprop_object properties\n", + "# full list of properties is here https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops\n", + "print(\"area :\", regionprop_head.area)\n", + "print(\"centroid :\", regionprop_head.centroid)\n", + "# display the image of the new mask correponding to the clean trait mask\n", + "plt.imshow(regionprop_head.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, "id": "f5eea310", "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACKCAYAAABRuwqNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOe0lEQVR4nO3de3CV9Z3H8fc3MQESLga5NAu0RKHUy2zRMqjFui5oC2grbbcV29qMYxd3BVfEdQeG6bo7W2fcdRZ3xql2rdqiVVlXpbKOlSKy22mpXAVKDBEENFlCAspyCZfknHz3j/OkHsjJ/Zw8T558XjNnznN+58l5PlzyycnvPOf8zN0REZF4yQs7gIiIZJ/KXUQkhlTuIiIxpHIXEYkhlbuISAyp3EVEYihn5W5mM82sysz2mNniXB1HRERas1yc525m+cB7wA1ADbAJuNXd3836wUREpJVcPXOfCuxx973u3gisAG7O0bFEROQc5+XocccA1Wm3a4Ar29q50Ab4QIpzFEVEJJ6Oc+Swu4/MdF+uyt0yjJ01/2Nm84B5AAMp4kqbkaMoIiLx9Ka/9EFb9+VqWqYGGJd2eyxwIH0Hd3/C3ae4+5QCBuQohohI/5Srct8ETDSzMjMrBOYCq3J0LBEROUdOpmXcPWFmC4DVQD7wtLtX5OJYIiLSWq7m3HH314HXc/X4IiLSNr1DVUQkhlTuIiIxpHIXEYkhlbuISAyp3EVE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IyIiOSAyl1EJIZU7iIiMaRyFxGJIZW7iEgMqdxFRGJI5S4iEkMqdxGRGPp/FDdh7KZwHJoAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# Example with other image with 2 pevilc fins\n", + "# load the test image, you can add more test image if you have bug related to specific images.\n", + "segmented_file = '../Test_Data/INHS_FISH_18609_segmented.png'\n", + "img_seg_2 = tc.segmented_image(segmented_file)\n", + "masks_dict_2 = img_seg_2.mask\n", + "plt.imshow(masks_dict_2['pelvic_fin'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "6bb2a90a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAADhCAYAAADRVO5tAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOk0lEQVR4nO3df6zdd13H8eeLWlo2RFrYlrJOB0lBCIEOb8ZwxsyVaZlk85+ZzWD6x5L+g3EoCes0McGEZCaG4B/GpBGkEQQnP9yyEEctLEZDgAJldJStkx+jrK4wQKYkSwdv/zjfytnZ/XHur/P9fnqfj+Tke77fe849r55777vvvu/n+22qCklSe57TdwBJ0spYwCWpURZwSWqUBVySGmUBl6RGWcAlqVGrKuBJ9iZ5KMkjSQ6sVShJ0tKy0nXgSTYBDwPXAaeAzwO3VNVX1y6eJGkhP7eK514JPFJVXwdI8mHgRmDBAv7cbKmtXLiKl1zYy1/z43X5vLP08AMX9B1B0gA9yQ++V1UXTR5fTQG/FPj22P4p4PWLPWErF/L67FnFSy7svvuOrcvnnaXfesnuviNIGqB/rY98a77jqyngmefYs+YxSfYD+wG2YocpSWt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4J/RN8tp4Cyj7uRW4EWMfil2sttun3GmX2M0UnoAONbdrh9ArtcAX+pyHQf+rDvea66xfNfws19i9v1evQz4cnd78Nz3eN+5ugy7gaPd1/GfgW0DyXUB8ATwC2PH+v46vpNRk3Ic+HtgS9+ZFrp5JqYkNcozMSWpURZwSWqUBVySGmUBl6RGWcAlqVEWcElqlAVckhplAZekRv0f1OlppFqvNtEAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "# During the clean step we remove the small blod and keep only the big one\n", + "regionprop_pelvic = img_seg.clean_trait_region(masks_dict_2['pelvic_fin'])\n", + "plt.imshow(regionprop_pelvic.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "03bf6f15", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'dorsal_fin': {'number': 1, 'percentage': 1.0}, 'adipos_fin': {'number': 0, 'percentage': 0}, 'caudal_fin': {'number': 1, 'percentage': 1.0}, 'anal_fin': {'number': 1, 'percentage': 1.0}, 'pelvic_fin': {'number': 2, 'percentage': 0.9156065777226187}, 'pectoral_fin': {'number': 1, 'percentage': 1.0}, 'head': {'number': 1, 'percentage': 1.0}, 'eye': {'number': 1, 'percentage': 1.0}, 'caudal_fin_ray': {'number': 0, 'percentage': 0}, 'alt_fin_ray': {'number': 0, 'percentage': 0}, 'trunk': {'number': 2, 'percentage': 0.9499680160833409}}\n" + ] + } + ], + "source": [ + "# The presence matrix is created using the following function\n", + "presence = img_seg_2.get_presence_matrix()\n", + "# or directly access the variable\n", + "presence = img_seg_2.presence_matrix\n", + "print(presence)" + ] + }, + { + "cell_type": "markdown", + "id": "4f2d1e48", + "metadata": {}, + "source": [ + "### 3- Collect properties and landmark\n", + "\n", + "In this section there are multiple small functions to calculate and extract what we want from the mask, using either direct calculation on the mask or using the regionprop_object. You can explore the class on the repo, there are plenty of small functions with some redundancy (with different way calculate the same value) and some that are not necessarly used and function in jupyter notebook (particular visualisation functions)\n", + "\n", + "List of funtion: \n", + "\n", + " + img_seg.landmark_generic(trait_name) : return the most front_point , back_point, top_point, bottom_point, centroid, new_mask\n", + " + img_seg.landmark_5_7 : calculate specifically the landmark 5 7\n", + " + img_seg.all_landmark() : combine all the landmark in a dictionnary\n", + " + img_seg.visualize_landmark() : plot landmark on the original segmentation\n", + " \n", + "Now play" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "b64417f6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "most front point: (148, 36)\n", + "most back point: (162, 187)\n" + ] + } + ], + "source": [ + "front_lm, back_lm, top_lm, bottom_lm, centroid, new_mask = img_seg.landmark_generic('head')\n", + "print(\"most front point:\", front_lm)\n", + "print(\"most back point:\", back_lm)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "8208aa2c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'1': (148, 36),\n", + " '2': (66, 148),\n", + " '3': (21, 301),\n", + " '4': (106, 566),\n", + " '5': (112, 606),\n", + " '6': (150, 622),\n", + " '7': (203, 592),\n", + " '8': (200, 562),\n", + " '9': (242, 478),\n", + " '10': (279, 305),\n", + " '11': (217, 169),\n", + " '12': (162, 187),\n", + " '13': (224, 138),\n", + " '14': (136, 66),\n", + " '15': (134, 96)}" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# landmark dictionnary\n", + "img_seg.all_landmark()" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "99b54f95", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAyAAAAE7CAIAAACqnHJOAAAY90lEQVR4nO3dbW6jyrqA0Tooo7gjPIOILGR5EFt7gGcUkXV/4KYJxhgwUF9rqdXqdBzHSbvtJ28VOAQAAAAAAAAAAAAAAEjEf2LfAKAW99n3NifdCoAzCCxgT/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YbJFOYHVkFltIK+AwAouNUmusjtLiDVEFnEJgsVGagdVTWoxJK+BEAovtEm+sILMQVUAkAovt0g+sjswqkHIC0iaw+EgujRVkVvo0E1AQgcWnNBYrXK8HXnnTHHjlAGsILD6VUWAFjXWC2y3cE7hLiC0gKoHFDjRWpRJpqVc0FhCPwGIfGTVWFYE12s/0nEFv4yPlclpOYwGRCCx2k0tjlRZYh+5qyp3AAiL5in0DKEcTmlwaK3uiCiBtAos9aaxPtF+//j+2Pz8TF5JWADkQWOxMY20wSqvhX/7NLGm1lvVBIB6Bxf6a0IR8tmTFNZlWzxdoL2XtGzuBugKi8hjEURr3rnfe1tXfSxpfLdQ0j18AUZlgcSDLhRxOSwFJcpoGDpdaYyVymobh+Kpt2/73yT883rRQ2BFVQPI8TnE4a4Uz2rYdV9QgtkbvqlG/5Df8BZA8D1WcQWON9OOr58Ca+6hidmJNZpOWAgpiDxYncWhhvXQSUB+Bxan6UZbSKpyoAurmQZA4+kWg8z/v+IWQ+ZClPYAnjiIkISeMtf4m3ff30Z9rxnAP1vhdg11ZE+897kBCVQSwH4FFig4qrYmBWbzMWn6W0b8f0vfWffb7I5UAYrMHixSdtyP+ebnwnOS63cInp2CQUABpM8EiJ2uTK/HTQ6w6zZVzYgFkxASLnCQeTADQ8XQF0aw4xajxFUBWLBFCfDP9JK0AciSwIBWTL0oIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOTj/wGZVIJ92gsmjAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Visualize the landmark\n", + "img_seg.visualize_landmark()" + ] + }, + { + "cell_type": "markdown", + "id": "bd018bc8", + "metadata": {}, + "source": [ + "### 3- Measurement part\n", + "\n", + "Functions to calculate what we need to measure what we want!!!\n", + "\n", + " + img_seg.get_distance(a,b) : measure distance between two point\n", + " + img_seg.measure_eye_area()\n", + " + img_seg.measure_head_area()\n", + " + img_seg.measure_eye_head_ratio()\n", + " + img_seg.calculate_triangle_area(point_1, Poit_2, point_3)\n", + " + img_seg.measure_eye_diameter()\n", + " + img_seg.all_measure() create the following dictionnary using the previous fucntions:\n", + " + measure['SL'] = self.get_distance(landmark['1'],landmark['6'])\n", + " + measure['EA'] = self.measure_eye_area()\n", + " + measure['HAt'] = self.calculate_triangle_area(landmark['1'],landmark['2'],landmark['13'])\n", + " + measure['HAp'] = self.measure_head_area()\n", + " + measure['HCL'] = \"WIP\"\n", + " + measure['ED'] = self.measure_eye_diameter()\n", + " + measure['HL'] = self.get_distance(landmark['1'],landmark['12'])\n", + " + measure['HD'] = self.get_distance(landmark['2'],landmark['13'])\n", + " + measure['pOD'] = self.get_distance(landmark['1'],landmark['14'])\n", + "\n", + "Now play!" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "f4bf0c4f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'SL': 586.0034129593445,\n", + " 'EA': 922,\n", + " 'HAt': 8437.999999999995,\n", + " 'HAp': 16034,\n", + " 'HCL': 'WIP',\n", + " 'ED': 34.262616074167774,\n", + " 'HL': 151.64761785138597,\n", + " 'HD': 158.3161394173064,\n", + " 'pOD': 32.31098884280702}" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "img_seg.all_measure()" + ] + }, + { + "cell_type": "markdown", + "id": "e033c2f9", + "metadata": {}, + "source": [ + "## Development Section\n", + "\n", + "This is where we make a mess!!!" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "add5f243", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "82724" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADdCAYAAABAMDLCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGli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wBRgIGqbk4BzzCybsiHe08zsZeK0XbxO7j8AHcysrZnVAy6kbA/WePc+MCz0fhjwXrnyuNif9kB796K2wcyamtnhoff1gTOAxcR52zjn7nLOtXTOtaEsl3zpnBtCvLaL13d0gd9SNhNiOfBXr+Px4Pd/DcgBSijrSVwJNAa+AJaFXtPL1f9rqK2WAL/xOv4wtsvJlP2J/BMwJ/TzW7WNA+gOzA61zXzg76HyuG+bcr/vAH6ZLROX7aInVEVEYpDXwzIiIhIGSu4iIjFIyV1EJAYpuYuIxCAldxGRGKTkLiISg5TcRURikJK7iEgM+v94zGEOtozB3AAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "trunk_pro = img_seg.clean_trait_region(masks['trunk'])\n", + "trunk_mask = trunk_pro.image\n", + "pad_mask =np.pad(trunk_mask, ((1, 1), (1,1)), 'constant', constant_values=((0, 0),(0,0)))\n", + "list_contour = ski.measure.find_contours(trunk_mask)\n", + "erosion_trunk = ski.morphology.erosion(pad_mask)\n", + "plt.imshow(pad_mask)\n", + "np.all(pad_mask == erosion_trunk)\n", + "sum(sum(pad_mask))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "982c2856", + "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 30, + "id": "d452f502", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(264, 474)\n", + "(262, 472)\n", + "1277.9453095790602\n", + "1277.9453095790602\n" + ] + } + ], + "source": [ + "print(pad_mask.shape)\n", + "print( trunk_mask.shape)\n", + "print(ski.measure.perimeter(trunk_mask))\n", + "print(ski.measure.perimeter(pad_mask))" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "5d3ae5d3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n", + "1427\n", + "(1495, 2)\n", + "1128\n", + "125136\n" + ] + } + ], + "source": [ + "contour_1 = ski.measure.find_contours(trunk_mask)\n", + "print(len(contour_1))\n", + "print(sum([a.shape[0] for a in contour_1]))\n", + "\n", + "contour_2 = ski.measure.find_contours(pad_mask)[0]\n", + "print(contour_2.shape)\n", + "\n", + "contour_ = np.logical_and(pad_mask, np.logical_not(erosion_trunk))\n", + "print(sum(sum(contour_)))\n", + "contour_3 = ski.measure.find_contours(contour_)[0]\n", + "print(sum([a.shape[0] for a in contour_]))" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "id": "ee1e920f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[array([[262.5, 145. ],\n", + " [262.5, 144. ],\n", + " [262.5, 143. ],\n", + " ...,\n", + " [261.5, 146. ],\n", + " [262. , 145.5],\n", + " [262.5, 145. ]])]" + ] + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADdCAYAAABAMDLCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAooElEQVR4nO3deXhdVbn48e97hpyTpEmapJmTJmmbNG0RWiilBQdGBURBH+FWfyoIV8SrV1EEQcABRFFkUK+gVbiCIsgVB0BECloc2tKJFtqmmZo0c9Kmmeezz/r9cU4hpUmTZtpneD/Pk+ecs/ba+7xZ4tuVtddeS4wxKKWUiiwOuwNQSik1/TS5K6VUBNLkrpRSEUiTu1JKRSBN7kopFYE0uSulVASaseQuIheKSJmIVIrIzTP1PUoppY4lMzHPXUScQDlwAVAPbAU+aozZO+1fppRS6hgz1XNfBVQaY/YbY4aAJ4FLZ+i7lFJKvY1rhq6bA9SN+FwPnDFW5RjxGC/xMxSKmgx/cjxGRj8mfoOjo292A1JKHaOb9kPGmLTRjs1Uch8tLRw1/iMi1wLXAniJ4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DSKSC7wf+MWI4qhsF7uTew5QN+LzqPutRqEME9iYnOBrerA8KtvrbXv3atvw5tDDTqAVWG+M0bYJeAC4iaNXy4jKdrE7uU9ov1X1pqhrr1H27h2z6ihlEds2JrDF5XIC21iuEpGTjlM9KtpGRC4BWo0x2yd6yihlEdMudid33W91dC1HtjEMvrYGy6OqvUbbuxdtm6MYYzqADcCFaNucBXxQRGoIDPGeKyK/Jkrbxe7kvhUoEpFCEYkB1hLYgzXaPQNcGXx/JfCnEeVRsT/tWHv3om2DiKSJyNzg+1jgfGAfUd42xphbjDG5xpgCArnkb8aYjxOt7WL3HV3gYgIzIaqAW+2Ox4bf/wmgCRgm0JO4BkgFXgYqgq8pI+rfGmyrMuAiu+OfwXZ5J4E/kV8HdgZ/Lta2MQAnA68F22Y38PVgedS3zYjf92zemi0Tle2iT6gqpVQEsntYRiml1AzQ5K6UUhFIk7tSSkUgTe5KKRWBNLkrpVQE0uSulFIRSJO7UkpFIE3uSikVgf4/w2y4BiGfKVsAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "contour_ = np.logical_and(pad_mask, np.logical_not(erosion_trunk))\n", + "plt.imshow(contour_)\n", + "list_contour = ski.measure.find_contours(contour_)\n", + "list_contour_2 = ski.measure.find_contours(pad_mask)\n", + "list_contour_2\n" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "id": "f5abdcdd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1495, 2)" + ] + }, + "execution_count": 88, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a =list_contour_2[0]\n", + "a.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 93, + "id": "a7e0885b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1280.7737367037953" + ] + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "distance = lambda a,b: ((a[0] - b[0])**2 + (a[1] - b[1])**2)**0.5\n", + "distance(list_contour_2[0][0,:],list_contour_2[0][1,:])\n", + "a =list_contour_2[0]\n", + "list_segment = [distance(a[i,:],a[i+1,:]) for i in range(a.shape[0]-1)]\n", + "sum(list_segment)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "84e350d9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAADcCAYAAACLbOFnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAjRklEQVR4nO3dd3xUVd7H8c9vJiEhRKoUKdKLoC4CAtaH1bWsDXdtuKxiAxV1RX3s7uPqa3XXvjZcUVx1dXWxIepaEGUVqUFAhVBCUYKhKEFJQpIp5/kjAwZJI5nJnfJ9v155zcyZO/f+OMo3l3PvnGPOOUREJLn4vC5ARESiT+EuIpKEFO4iIklI4S4ikoQU7iIiSUjhLiKShGIW7mZ2opmtMLM8M7spVscREZE9WSzuczczP7ASOA7IBxYA5zrnlkX9YCIisodYnbkPBfKcc2ucc+XAy8DIGB1LRER+Ji1G++0ErK/0Oh8YVnkDMxsHjAPw4x+cRfMYlSI7md9PsEVmrduFMuDAtluqfX9laQtC3zXZoz1tezkuEGhQjSJSd9sp/M4517aq92IV7lZF227jP865ScAkgObW2g2zY2NUSmrxDezPimurDvB9mu9gydCX6rinLnt97F8uPYevC9oA0O+69YS2VP8LQkQa7kP36tfVvRercM9n93ToDHwbo2OlFp8fG3QAWMXvz5UXZPHg8S/uerut/3OOyPTmJqiPB7wJAyqefzAnnRKXUeV2f7nzPFotL9qtzb5cRbi0NNYliqSMWIX7AqC3mXUHNgCjgN/F6FhJKXjMYPKP2XPoI9TUsWLURPx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ftQIM85t8Y5Vw68TMUyfSnDOfcJsPVnzSOB5yLPnwNOr9T+snOuzDm3Fti5hGFScs4VOOc+jzzfDuxc4jHl+8dVKIq8TI/8ONQ3mFln4GTg6UrNKdcvXod7J2B9pddVLsmXgtq7irVriTy2i7SnbH/9bIlH9Q+7hh4WA5uB6c459U2FvwE3AOFKbSnXL16He52W5JNdUrK/qljisdpNq2hL2v5xFSuhDaRitbOhZnZgDZunRN+Y2SnAZufcwrp+pIq2pOgXr8NdS/JVbdPOla4ij5sj7SnXX1Ut8Yj6ZzfOuW3ATOBE1DdHAKeZ2ToqhnmPMbMXSMF+8TrcFwC9zay7mTUBRlGxTF+qmwaMiTwfA7xZqT1lljCsbolH1D+YWVszaxl53hT4FbCcFO8b59zNzrnOzrluVOTJR86535OK/eL1FV3gJCruglgN3Op1PR78+V8CCoAAFWcRFwNtgBnAqshj60rb3xrpqxXAr72uP8Z9cyQV/0T+Algc+TlJ/eMADgYWRfrmK+D/Iu0p3zeV/rwj+OlumZTrF00/ICKShLwelhERkRhQuIuIJCGFu4hIElK4i4gkIYW7iEgSUriLiCQhhbuISBL6fwONMOKw0iCYAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(trunk_pro.image)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, "id": "6ee0446b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAACnCAYAAADqiRxlAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAU0UlEQVR4nO3deXhU9b3H8fd3JhshBBI2MSBgDCBwRZQCiqVc0IrW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WrK3m45j7sa2GCMKfI9tmvOJrO63L8BUkQk2fcbdDI1F/uwE1tdlEREBHgF2GGMed7GOYPiIi/GmOnGmO7GmN7U/P/7whhzm91yikiMiLQ9fp+aceJtdstpjCkEckWkv2/RFdRc28FWOWu5hRNDMsfz2DFn01k96A+Mo+aIjyzgNxZneQcoAFzU/Ka+C4inZmfbbt9tx1rr/8aXOwO4uoUyfp+aPwe3AJt8H+NsmHMwsNGXcxvwlG+5rXKekvkyTuxQtVVOasayN/s+0o//rNgtp+99hwBpvu/9QiDOpjmjgYNA+1rLbJfzbD/0DFWllApBVg/LKKWUCgAtd6WUCkFa7kopFYK03JVSKgRpuSulVAjScldKqRCk5a6UUiFIy10ppULQ/wPc4J223O+wUQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] @@ -237,7 +903,7 @@ } ], "source": [ - "caudal_fin = img_seg.mask['caudal_fin']\n", + "caudal_fin = img_seg.mask['trunk']\n", "\n", "plt.imshow(caudal_fin)" ] @@ -371,14 +1037,6 @@ " \n", "visualize_landmark(img_arr,lm_7)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fadc18fa", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/Scripts/Morphology_main.py b/Scripts/Morphology_main.py index 5bd9f1b..0fe0a8d 100755 --- a/Scripts/Morphology_main.py +++ b/Scripts/Morphology_main.py @@ -7,6 +7,7 @@ """ import Traits_class as tc import json, sys +import numpy as np def get_scale(metadata_file): @@ -27,6 +28,18 @@ def get_scale(metadata_file): unit =[None] return scale , unit +# this class is used by json.dump to control that every value as the right format +# particular problem encounter with np.int64 value type +class NpEncoder(json.JSONEncoder): + def default(self, obj): + if isinstance(obj, np.integer): + return int(obj) + if isinstance(obj, np.floating): + print(obj) + return float(obj) + if isinstance(obj, np.ndarray): + return obj.tolist() + return json.JSONEncoder.default(self, obj) def main(input_file, metadata_file, output_measure, output_landmark, output_presence, output_lm_image=None): @@ -43,8 +56,9 @@ def main(input_file, metadata_file, output_measure, output_landmark, output_pres measurement['unit'] = unit # Save the dictionnaries in json file + # use NpEncoder to convert the value to correct type (np.int64 -> int) with open(output_measure, 'w') as f: - json.dump(measurement, f) + json.dump(measurement, f, cls=NpEncoder) with open(output_landmark, 'w') as f: json.dump(landmark, f) diff --git a/Scripts/Traits_class.py b/Scripts/Traits_class.py index d5814b5..7423840 100644 --- a/Scripts/Traits_class.py +++ b/Scripts/Traits_class.py @@ -362,13 +362,33 @@ def all_landmark(self): # reorder the key new_landmark={} - list_order = [str(i) for i in range(1,19)] + list_order = [str(i) for i in range(1,16)] for key in list_order: new_landmark[key] = landmark[key] return new_landmark + def measure_eye_area(self): + ''' + Calculate eye area after cleaning and filing hole + + ''' + mask = self.mask + eye_region = self.clean_trait_region(mask['eye']) + + return eye_region.area + + def measure_head_area(self): + ''' + Calculate head area after cleaning and filing hole + + ''' + mask = self.mask + head_region = self.clean_trait_region(mask['head']) + + return head_region.area + def measure_eye_head_ratio(self): ''' Create eye head area ratio @@ -376,13 +396,13 @@ def measure_eye_head_ratio(self): 2- Area eye after cleaning and filing hole 3- ratio ''' - mask = self.mask - head_region = self.clean_trait_region(mask['head']) - eye_region = self.clean_trait_region(mask['eye']) + eye_areaa = measure_eye_area() + head_area = measure_head_area() - eye_head_ratio = eye_region.area/head_region.area + eye_head_ratio = eye_area/head_area - return eye_head_ratio + return eye_head_ratio + def measure_eye_diameter(self): ''' @@ -392,7 +412,7 @@ def measure_eye_diameter(self): mask = self.mask eye_region = self.clean_trait_region(mask['eye']) - eq_diameter = (eye_region.area/math.pi)**0.5 + eq_diameter = eye_region.equivalent_diameter_area return eq_diameter @@ -407,6 +427,19 @@ def measure_head_length(self): return head_length + def calculate_triangle_area(self, point_1, point_2, point_3): + + # calculate the semi-perimeter + a = self.get_distance(point_1, point_2) + b = self.get_distance(point_2, point_3) + c = self.get_distance(point_3, point_1) + + s = (a + b + c) / 2 + + # calculate the area + area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 + return area + def measure_head_depth(self): ''' Measure vertical length of the head passing by the center of the eye @@ -433,16 +466,15 @@ def all_measure(self): landmark = self.landmark measure={} # Standard length body length - measure['A'] = self.get_distance(landmark['1'],landmark['6']) - measure['B'] = self.measure_eye_head_ratio() - measure['C'] = self.measure_eye_diameter() - measure['D'] = self.measure_head_depth() - # Head length landmark 2 to 15 - measure['E'] = self.get_distance(landmark['2'],landmark['15']) - # - measure['F'] = self.get_distance(landmark['1'],landmark['14']) - # - measure['G'] = self.get_distance(landmark['1'],landmark['6']) + measure['SL'] = self.get_distance(landmark['1'],landmark['6']) + measure['EA'] = int(self.measure_eye_area()) + measure['HAt'] = self.calculate_triangle_area(landmark['1'],landmark['2'],landmark['13']) + measure['HAp'] = self.measure_head_area() + measure['HCL'] = "WIP" + measure['ED'] = self.measure_eye_diameter() + measure['HL'] = self.get_distance(landmark['1'],landmark['12']) + measure['HD'] = self.get_distance(landmark['2'],landmark['13']) + measure['pOD'] = self.get_distance(landmark['1'],landmark['14']) return measure def visualize_landmark(self): diff --git a/Scripts/Usage.txt b/Scripts/Usage.txt index 2307534..c4524e5 100644 --- a/Scripts/Usage.txt +++ b/Scripts/Usage.txt @@ -1,10 +1,11 @@ #!/usr/bin/bash -# Usage : python Morphology_main.py -# : segmented_ image in png : INHS_122505_segmented.png +# Usage : python Morphology_main.py +# : segmented_ image in png : INHS_122505_segmented.png +# : metadata file in jason format : INHS_122505.json # : ouput file name for measure {'A':x,'B':y...} # : ouput file name for landmark dictionary {'1':[x,y],'2':[x,y]....} # : presence dictionary {"dorsal_fin":{number:2 , percent:0.96 },'trunk':{}...} # : image with landmark -python Morphology_main.py INHS_122505_segmented.png measure.json landmark.json presence.json image_lm.png +python Morphology_main.py INHS_122505_segmented.png metadata.json measure.json landmark.json presence.json image_lm.png diff --git a/Scripts/__pycache__/Traits_class.cpython-37.pyc b/Scripts/__pycache__/Traits_class.cpython-37.pyc deleted file mode 100644 index fe0aae7..0000000 Binary files a/Scripts/__pycache__/Traits_class.cpython-37.pyc and /dev/null differ diff --git a/Scripts/__pycache__/Traits_class.cpython-38.pyc b/Scripts/__pycache__/Traits_class.cpython-38.pyc deleted file mode 100644 index 42dcbbe..0000000 Binary files a/Scripts/__pycache__/Traits_class.cpython-38.pyc and /dev/null differ diff --git a/Scripts/test_images/INHS_FISH_000742.json b/Test_Data/INHS_FISH_000742.json similarity index 100% rename from Scripts/test_images/INHS_FISH_000742.json rename to Test_Data/INHS_FISH_000742.json diff --git a/Test_Data/INHS_FISH_000742_image_lm.png b/Test_Data/INHS_FISH_000742_image_lm.png new file mode 100644 index 0000000..2d219e7 Binary files /dev/null and b/Test_Data/INHS_FISH_000742_image_lm.png differ diff --git a/Test_Data/INHS_FISH_000742_landmark.json b/Test_Data/INHS_FISH_000742_landmark.json new file mode 100644 index 0000000..9c4aa62 --- /dev/null +++ b/Test_Data/INHS_FISH_000742_landmark.json @@ -0,0 +1 @@ +{"1": [148, 36], "2": [66, 148], "3": [21, 301], "4": [106, 566], "5": [112, 606], "6": [150, 622], "7": [203, 592], "8": [200, 562], "9": [242, 478], "10": [279, 305], "11": [217, 169], "12": [162, 187], "13": [224, 138], "14": [136, 66], "15": [134, 96], "16": [115, 81], "17": [153, 81], "18": [135, 81]} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_000742_measure.json b/Test_Data/INHS_FISH_000742_measure.json new file mode 100644 index 0000000..7c2ddc4 --- /dev/null +++ b/Test_Data/INHS_FISH_000742_measure.json @@ -0,0 +1 @@ +{"A": 586.0034129593445, "B": 0.057502806536110763, "C": 17.131308037083887, "D": 145, "E": 85.60373823613078, "F": 32.31098884280702, "G": 586.0034129593445, "scale": 284.082, "unit": "cm"} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_000742_presence.json b/Test_Data/INHS_FISH_000742_presence.json new file mode 100644 index 0000000..7aec16d --- /dev/null +++ b/Test_Data/INHS_FISH_000742_presence.json @@ -0,0 +1 @@ +{"dorsal_fin": {"number": 1, "percentage": 1.0}, "adipos_fin": {"number": 0, "percentage": 0}, "caudal_fin": {"number": 1, "percentage": 1.0}, "anal_fin": {"number": 1, "percentage": 1.0}, "pelvic_fin": {"number": 1, "percentage": 1.0}, "pectoral_fin": {"number": 1, "percentage": 1.0}, "head": {"number": 1, "percentage": 1.0}, "eye": {"number": 1, "percentage": 1.0}, "caudal_fin_ray": {"number": 0, "percentage": 0}, "alt_fin_ray": {"number": 0, "percentage": 0}, "trunk": {"number": 2, "percentage": 0.992120507069956}} \ No newline at end of file diff --git a/Scripts/test_images/INHS_FISH_000742_segmented.png b/Test_Data/INHS_FISH_000742_segmented.png similarity index 100% rename from Scripts/test_images/INHS_FISH_000742_segmented.png rename to Test_Data/INHS_FISH_000742_segmented.png diff --git a/Test_Data/INHS_FISH_18609.json b/Test_Data/INHS_FISH_18609.json new file mode 100755 index 0000000..0cc14d8 --- /dev/null +++ b/Test_Data/INHS_FISH_18609.json @@ -0,0 +1 @@ +{"INHS_FISH_18609": {"fish": [{"foreground": {"mean": 87.09627354520009, "std": 44.15772761903212}, "background": {"mean": 214.81002430155465, "std": 13.388967131670137}, "bbox": [757, 982, 2986, 1665], "pixel_analysis_failed": false, "extent": 0.495518626924609, "eccentricity": 0.9753541990809838, "solidity": 0.671066442280065, "skew": [0.2478602080721569, -0.07787108966393692], "kurtosis": [-0.7858921121608158, -0.6651787900333743], "std": [526.1135453290792, 124.76446621771217], "mask": {"start_coord": [1822.0, 1631.0], "encoding": "666766766676676677667757676766776766767676767677667767677677677766777777667777767676776076777607670767767776767667777607677776777767760760776076777767777677777777677676776777776776777677767777677767777777760777767666667666666666756566656654360077666766666666666666666676566665765676666766676666666666666766666666566666666666666666576666666676666566676666667666666766666666666766666566667666676666676667666667666666576666766666766676666666666666676665556656676566767077665445677666676776765666007555344323333323234323323322476677666753332433243243324324434470007577777707666655533334333333433344344544443344333324324455431144447765766776667667675676776676667776767767607677777675767777660776077777707075444777777707707777077607670707607707707770770770707777767666766766766766766766676676667676676676676766767667667667676667667666676666666766767677676766666676676676676766767667676666667666667666766667667666766676667666766676666766766767676767667676767666766767667667666666667666766766667666666676666667666766666766766667666766676666667666676666766667666766667676666767666766766676766766767666766676766676766676667667667676767767676776767676776767767676776776776776777677677767767677677677777677777677767676676776676767667676676766766767676676677770700700700007707770070000000000000101000110010101101101102101101102111111112111111111101021121110111111211112121210221221211221223121123122212121222221212221211222221221312211221222122212121221222122212112122222212122121211222221222222121221222221212221221321122222122221212222212212222121213222222122132121222212222212222212122221222222212122222221212212222222122221221312212222222222122222221221222221212212221212222122122212221222122212212222222212222222122222122222122222122222212222212222221222222212221222221221222221222222212222222121221222103232221222222222222132122222212222222212222222222212222222221212322112222232212222222322122222222122222222222222212222222222222222222222222212222222132222222232222222222222222222222322222222221123222222222222322322222222222322222223222222222222222223223222213322322222222221312222222222221232222221222312232231223222322222222222222222222222222222222222222221222222222122222222222212212212212212121221122122122121212122221222122122212122221122121212221212222122122212212212221221222212122122212212212221222122212212222122122222112222212221222212221222222122222232223222212222122213122212212122222222122221222222222122212221222222212212222222211313212222221232224321021234357553221132222117667566100223212234553222110761123346533113131076600222321346755431222221107023443223122221771032243443210001244323222222222224576756756665666676656576666553607666665675666666665666657575665344532556000755775666544677666565655407107675453556666600775465676665655566017556556566566656656666666566566656654666565666566654666667565466675666666665656656666655356560754756666656666665566666566665655432221212222212222221221222221222131022122231221222221222122131222122221221213122222212213212121132222121234321231221700222454321023222210217702134365322122131112321107024443103212231221212221313121231123211232112231222212222131222123212217232221222236556666667656665666656666566566666566575567754657565675666655322132212222365656075566566665766607754344432212222122223221222213113222222222213221224431001224343222231312222313123222122222213221321223226533145666775567075535666667565666766650076666665575444660117665666665657566660767601757665757566665666544075656775532346566665666675675766665666675365666656666665666656666656665576666656666666567665475765445331222211322222121023231221222222226654753331222221077621122223467544312232211170002222222212132213466543321222221007001321326565443132211312170765702221222122221244322100022444444321072212122223211132222453211002432456653566717667565446076575444543331113245313100022235321012433134433102310771334322445312101233212222322213132222566666666656666665675657666665543245444432122312466576666576566666666666107776656653313235653443223332346655607754566666566766666676665667665757666754660765665765467765566501765576665665607666666554665767566666656666666666666666557546777546566567666775754665666666666665532223222222221232222222222223222131222222210072223453312222222212232122222222222222444321012131223455322212311007613223112234666654431322131232222210007022443243322101217013453222222212222132222432222344457077665760756666666543222222222231326566666666666675666666667576666575332222132222222323310222222222343223322213100123455532231311223322232211233322223110343236657666676675666666576676666666656766666766666666676666666576666676656666666676666675667576666622222222222217666666666667666666766666666532222232666667650776532565757660221076666666666666766667544332222266666666667576665766666665657766533331233221322222222232222222222222223122222222222222212322222212232223122343323222211000245433222222311000353323101232222213324443453235766654601710766545666676666543223222232246567666766766666766666756676666667665346717676566766666666665455707666675667667566667656666676655331232323231223323222232232323222321132243112232432232222221043323100132443133321322222310001453331132212232212354310122334331123446667665766676543232222232322213323222223322232222322232223223222133222322222322322232232222322223222222322222322222321323223223223222322222322322222322232222232223223222232222313222322222322222322222322322232132223222222222223223222222223323222322222232222232222322222322222323322232222322322232222223222232232222322322223222232222322222322223223323222232223222232223222223222322222212433232222322222322232222322232232232223222322322322322322223223222232322322232322323222322222223222322222232222222332222222322222222222223222222222223232222222222222222222232222222210212122232111113322222212222122222222212222212232122212122223310221321221223221213212231122122222132222222122122222121213212145655655656565656656566565656656566565656655533111221212122212222122122122221122121112211032122122122122212221212321222122222122221323112132331122312122212222212212212222122122222210222321122222122122123112212231122223212102221123133311312121222221123212221223212221222122221022212232222221256656566666665665666654444543131222212211071134543211312222221222212222212222221222221122223122122221222222222212212222222222222122222231222212322122222132122222222222222236666666553123224666675665666666657665666661176676666665657665766656666566657657535322222122213132122212232122656656666656665666666666566566666566576566666557566754675543222221311223112321132212222122222221222122222222122122231223665666666566656533212365666076546656665656675532312222212222122222212222222222121456654322213221222222222566666666666665666567665665431222231222132212365666666666666566656666666565666676656665755665676575332231122222321312226566666656666665666655766656532222222212222222212213221222222212222223210022312222222222222212246666656653475653326566667566612222221000176655466566657656666666665532222122222222145666656756666554322121322222123266543132212222223311245444366566707755324666665666666653325566675601132100765666666566755343122322666666576656000076544446077676675666654444666666566676657566755775466767545665666666575656765676555676656656077545446532132212232122101443221032213310321702103232244312231312222222222107002132122222222222122222221322222222322122222221023322223122212356665434446666666610776566544665676566666665766666666755332266534466532212231322171132213177622225434666543221232222311001355324310170134532223235666765755076566666675666766656675666676656667656756576665007556766656656666656076656566775566666656666754543214322113310102224354431212225331711771222222321222222222232221232213222122232222544776557665331447666656670217666653245757666653447675667567667557666666666675756766666666666666666666657533132222222222132222222222222232222222222223222222222232213222231324310222222321223101143232534566011765654666666666675766576554077756666546765007567655775075666557766656675676665477666567666666555453223122311124532323221110222222244754321321000222232222223122321344543132211035322110034322222217677232332222102431222222122223112222231322222222132222221010245433122222225666657656666656666666656666666666656566765665666765656756666666666666665667666654507075540767666665754546607217665444546000007554454717654775466540776676545666654323122446765332225577665675676656667666676566543223122322312234666655656653322212332123232221070071232454444322322222223211113122222121222112210222212222117211713544322222107221143322102222225665665667765346666566566666566556655565666556566665565556565554544500001010076507765467776546075545666721177757667666653312346675443246600766701077576666577667556676665666766576077535660076666753443213332223213222223222172443210023123222123256657665353322217023214453222343233123117110225544445435555312322213323112170223444433265076666765767656677665554322133213223232212222466666656666666566655707665466660760766666675766576666532235666666667666666666676666666666667666666666766676666666707666667667766677666667665677666666666666676667665333222232222232222223222222232222322234434324312212223253121322222223222222223223122232322123224576676543223221143232222210002323310144322223321100224432231212323322222222210224331223121432222222222222222222322223226566666666665576665446607756653531223322123212211243122322222221003323222221231222222222225456666566755756654444533223322121102213533222123170124453223221221032234656566766565454765440077076535346755710076567755666676656666666666666666665766666665322322213131322443221761223122244754453223177122171223131222246666666665322324533110022222225756534655676666666666766666667666666666667675665331222322222322222222223222222223222222331223122355607567666665766757547675353222222356666756666667665766667666666533222222322221322223222222222232224665346753322223213123107666666660122102222234431102232132222466666555766665323222222231223217671232245322334576666676676567666766666666676666766666676666702176655465532222223223222232222313222322222322222232222322222322222223223132222223107123265534666766666666667666667666766576676657667576666676756507667666667653432232232223223311322232222345676666676676657766667576666667666766666756767566754332223213222322223222223222322223221332222222322222322322222232223222223221010766667666676666666675760132222232223132313222222453311024443653222222313224666666667666543222223221322223132366666766666675667676576666667666667666667666676667666667666676676666766532324666654323222322322322232222232322232222322322322223222232222331223222323222223223222210721766675350000756666667666667071224433112231223122214366532233332233122346667666666546567756766766666676676676666757667666676666767666667665346532232223223213112232232226665322223223132322312331235676666766757666676676666676666775676667666757676666676766676667666660765766766766576677666676676567776676666755332222332322223232223222322322322232232222322322232232232222323222232232223223222322232223232222322223223222232222322322107666676666776656767666776603222223232133122322232231000223132222224465323132222344576676676577666533223222231332476666677654766766766766667666766757666766675432322232223135667666677576676676676667667666676676667543223222323222322322322223223223223222322232222322324310232222322322222232232223666653466711766554433132231104443576667675775753322322323222357676666767666607657666677667667666676675777576676675776545432232322322322322322322223223223222323222232222332222322223223222357657766667665322322313322322222322365766607575332323232476766667766666677665432232322246676766676676666767660007545767667667766667766776666776666776676676767667667766766767666767666760713232322322322322232323222322322322223322232323222322323232222332231004432322232100077666676676676677566766766667676667667667667667667667667667667667667667667577667667667576656007676676676577676676676654443322332223232232232322323222323232323223223232322322232323223232232232323223223223223322322322322323223232232223232231332232232222332232231323222323222232232222347666676766676675667667756676676676676676676676677577666677666676767667676607567676667676676676676677667533223322323223232243466607667666767676776676676676677667676766776676767667667767666767676677766667766544333223312432223233232223322323232223233223223232322323232322322321332323223223222323222332233232231323232232231324322232223222233222321177666675767666766766766766776676666777667667667766760022332223322322322332232232232322323222233223123223223232222322322322246666676766667666532322322322223223223117760222325443100134653313223121022354335767577567567757576666766756076567667666766675766766766676667676577757766775757766666176766765454467666766076666667766600755760122231433133223114432232104443210107757766776666777566776677667543235546670117175535566767676676676760766666776667676676676677667766775407766767676660766676767667767667766653434453314313432321122354322224332222433222332124322332331223322232432133232322243100253431232332233231224312232332243102333223310134432232213332431222233133312223433101321234443102222531312243357765407757754577666666076576667676666775767766667675757677567766766677567676766660766667676667766667766767576767667667660766667676667767667667766676767676667766766677667676676776667676767666767667676766767767667667766767667676767676676666766766766767676766767676677666767666767676766676666766766766767667666767667666676667666766776766765766766667667676676666676767667667676666767667676667667667676767667666767677666666666676667666676676666667666656666666676666667666666666667666676666656666666666666666667666666666666666666666566666666666666576666666666666666666666656666666665666766666666666666666666666666566666666666666666766666666666756666765666666666666666766676666666545432212232221325466556766566575666666666666576666547755432222222222222222223222222322222232222222322324666676666666666666755676676666666666666666666666667656676656676656543243334766666667660024311077667176554444655400775667534766077666656576717654367576607546666667656676666766533223222222222332222322312233222123123222132332222232222223222322222232222232222313221322366666667666666666676666546676666665507754544577017577766654322266666655444322213214311345322100243243310345677755570765765476007547765470076566666577754675775766775567544466676617565675760100775345765465532222103432322232232223222322222321317103132223222322222331322223232322232222232232232223243550077666666766666766667533325446776657543233143222222232325666667567776655446766567675347534435432322232322221024343223214310013222444434667666766766676577666756076666666766767666676766577667676544465654332222233122223233321222222255660754675766676677666676543332222332322223433134322232353310034456554667762223107677676665346677010766776533446677710760755467667677577676776676767667767676677667766776676677667776767667766765076767667766767666677676676676776676754323322332223333222332323321232234323332322323311022332444432322224312333223233223322323222332332232313323232323223332232232323223223313223323233132332223323222322467666676666767676676756776677666675532554322532103122122354324313210014453234312431210245322324465466766676677666767656532234322532244322332222343223243132324324765077655347000757776576676576600007544477660076760775667677676677076662222107666776754466767767667676776677676776677677676767677767676767767677667767767766776767676767766767676776767676767667776675432332323233323232332322243323323223323232324432224443222233232253222233233310333343213323243334432213443332103326576554775445323333210003107670331344543555444607667667667676677607667676776767676767677676767657766766767676767767767667776777676677776677767677676767677767677766777677677767676676767677776776767677677667767776767666556676767767767676766666766665654545543332667656665453443266665757666666654431232322222322324366666667576653531232257666666766666654077655332232232322222322322223256676666666543232336540766546667544444666766667567675334322332223444323223223232431232366667676657540776557666676667544322322322333233222436576666607566766666767666765326553122243331343447765607667544333243123432431323244777665767757675447577665323232432343543532223334356666766007676776676076665343223333323243243235566667577667667667766766776676766776677676766766767667676675400776665476600717665076607570767660766777667533322543223332332432343323223343433123243245322223335322576776666076707653500076672107665607607777756757122107776076545347660000017765457760171755467667760775707576775070766775607666107677677566762177760757776675443353114335754432232244543223323323343143432333322333333243323322333322443332233233143323233332244666077565432133333332211072432233247660754443314323332222432431332322322102453333310433321332243317244"}, "cont_length": 4.7179585059491735, "cont_width": 1.5034970917438464, "area": 4.504737267877855, "feret_diameter_max": 5.63784148317858, "major_axis_length": 5.409564627019281, "minor_axis_length": 1.1935930231741352, "convex_area": 6.712803657074888, "perimeter": 52.52747621291417, "oriented_length": 0.014144178833632831, "oriented_width": 0.004533222436938909, "centroid": [1781, 1306], "has_eye": true, "eye_center": [953, 1190], "side": "left", "clock_value": 9, "primary_axis": [-0.9962345543010771, 0.08669897817468328], "score": 0.7899301648139954}], "has_fish": true, "ruler_bbox": [1108, 2473, 4760, 3700], "has_ruler": true, "scale": 390.4231030597885, "unit": "cm", "fish_count": 1, "detected_fish_count": 1}} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_18609_image_lm.png b/Test_Data/INHS_FISH_18609_image_lm.png new file mode 100644 index 0000000..25e9d44 Binary files /dev/null and b/Test_Data/INHS_FISH_18609_image_lm.png differ diff --git a/Test_Data/INHS_FISH_18609_landmark.json b/Test_Data/INHS_FISH_18609_landmark.json new file mode 100644 index 0000000..85d6d4d --- /dev/null +++ b/Test_Data/INHS_FISH_18609_landmark.json @@ -0,0 +1 @@ +{"1": [98, 38], "2": [51, 147], "3": [38, 326], "4": [71, 439], "5": [107, 599], "6": [138, 621], "7": [162, 586], "8": [163, 498], "9": [176, 416], "10": [172, 319], "11": [122, 188], "12": [100, 189], "13": [139, 120], "14": [80, 77], "15": [80, 120]} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_18609_measure.json b/Test_Data/INHS_FISH_18609_measure.json new file mode 100644 index 0000000..8937027 --- /dev/null +++ b/Test_Data/INHS_FISH_18609_measure.json @@ -0,0 +1 @@ +{"SL": 584.3706015877253, "EA": 1134, "HAt": 4161.499999999999, "HAp": 9397, "HCL": "WIP", "ED": 37.99807421080277, "HL": 151.0132444522665, "HD": 92.04890004774636, "pOD": 42.95346318982906, "scale": 390.423, "unit": "cm"} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_18609_presence.json b/Test_Data/INHS_FISH_18609_presence.json new file mode 100644 index 0000000..7548da1 --- /dev/null +++ b/Test_Data/INHS_FISH_18609_presence.json @@ -0,0 +1 @@ +{"dorsal_fin": {"number": 1, "percentage": 1.0}, "adipos_fin": {"number": 0, "percentage": 0}, "caudal_fin": {"number": 1, "percentage": 1.0}, "anal_fin": {"number": 1, "percentage": 1.0}, "pelvic_fin": {"number": 2, "percentage": 0.9156065777226187}, "pectoral_fin": {"number": 1, "percentage": 1.0}, "head": {"number": 1, "percentage": 1.0}, "eye": {"number": 1, "percentage": 1.0}, "caudal_fin_ray": {"number": 0, "percentage": 0}, "alt_fin_ray": {"number": 0, "percentage": 0}, "trunk": {"number": 2, "percentage": 0.9499680160833409}} \ No newline at end of file diff --git a/Test_Data/INHS_FISH_18609_segmented.png b/Test_Data/INHS_FISH_18609_segmented.png new file mode 100755 index 0000000..3237b66 Binary files /dev/null and b/Test_Data/INHS_FISH_18609_segmented.png differ diff --git a/Traits_description/Minnows_Landmarks_v1.csv b/Traits_description/Minnows_Landmarks_v1.csv new file mode 100644 index 0000000..25d7dc5 --- /dev/null +++ b/Traits_description/Minnows_Landmarks_v1.csv @@ -0,0 +1,16 @@ +type,landmarkNumber,terminology,position,anatomicalDefinition,codeDefinition +landmark,1,Tip of snout,anterior-most (left-most) part of head,, +landmark,2,Beginning of the scales at the dorsal side,dorsal (top) of head that meets the trunk,, +landmark,3,Anterior insertion of the dorsal fin,anterior-most (left-most) insertion point of dorsal fin,, +landmark,4,Posterior insertion of dorsal fin,posterior-most (right-most) insertion point of dorsal fin,, +landmark,5,Dorsal insertion of the caudal fin,anterior/dorsal (upper left) insertion point of caudal fin,, +landmark,6,End of vertebral column,midline of caudal fin,, +landmark,7,Ventral insertion of the caudal fin,anterior/ventral (lower left) insertion point of caudal fin ,, +landmark,8,Posterior insertion of the anal fin,posterior-most (right-most) insertion point of anal fin,, +landmark,9,Anterior insertion of the anal fin,anterior-most (left-most) insertion point of anal fin,, +landmark,10,Anterior insertion of the pelvic fin,anterior-most (left-most) insertion point of pelvic fin,, +landmark,11,Superior insertions of the pectoral fin,anterior-most (left most) insertion point of pectoral fin,, +landmark,12,Most dorsal point of operculum,posterior-most (right-most) part of head,, +landmark,13,Most ventral point of operculum,dorsal (lower) part of head that meets the trunk,, +landmark,14,anterior-most (left-most) part of eye,anterior-most (left-most) part of eye,, +landmark,15,posterior-most (right-most) part of eye,posterior-most (right-most) part of eye,, \ No newline at end of file diff --git a/Traits_description/Minnows_Landmarks_v1.png b/Traits_description/Minnows_Landmarks_v1.png new file mode 100644 index 0000000..e0feeeb Binary files /dev/null and b/Traits_description/Minnows_Landmarks_v1.png differ diff --git a/Traits_description/Minnows_Measurments_v1.csv b/Traits_description/Minnows_Measurments_v1.csv new file mode 100644 index 0000000..6190256 --- /dev/null +++ b/Traits_description/Minnows_Measurments_v1.csv @@ -0,0 +1,11 @@ +trait,abbreviation,type,anatomicalDefinition,codeDefinition +standard length, SL,distance,length from the tip of the snout to the posterior-most part of trunk that meets the caudal fin, +eye area, EA,area,area of the eye, +"head area, triangle", HAt,area,"area of head as outlined by three points: tip of snout (landmark #1), back of head (landmark #2), and ventral portion of head (landmark #13)", +"head area, pixels", HAp,area,area of head based on number of pixels, +eye area to head area, EHA,area,ratio of eye area to head area, +head-to-caudal length, HCL,distance,length along the dorsal side (top) from the back of the head (landmark #2) to the end of the peduncle (landmark #5), +eye diameter,ED,distance,length across the eye along the anterior-posterior (left-right) axis (landmarks #14 & #15), +head length,HL,distance,length from the anterior-most (left-most) part of the head (landmark #1) to the posterior-most (right-most) part of the head (landmark #12), +head depth,HD,distance,length from the dorsal-most (top) part of the head (landmark #2) to the ventral-most (bottom) part of the head (landmark #13), +snout length or preorbital depth,pOD,distance,length from the anterior-most (left-most) part of the eye (landmark #14) to the anterior-most (left-most)part of the head (landmark #1), \ No newline at end of file diff --git a/Traits_description/Minnows_Measurments_v1.png b/Traits_description/Minnows_Measurments_v1.png new file mode 100644 index 0000000..7fd40e0 Binary files /dev/null and b/Traits_description/Minnows_Measurments_v1.png differ