Code Monkey home page Code Monkey logo

microporella's People

Contributors

lilysandstrom avatar meghalithic avatar

Stargazers

 avatar

Watchers

 avatar  avatar

microporella's Issues

Measurements

The readme text explains the points on the figure showing landmark points 1 - 22 (overlayed on an image from Di Martino et al., 2023):
Autozooid (yellow shading, white lines):
 Shape:
  zooid height: 16-9
  operculum (pink shading): height between 6, 7, 8
  operculum base length (pink shading): 7-8
  proximal width: 22-10
  distal width: 17-15
  proximal side length: average between 22-19 and 10-13
  distal side length: average between 19-17 and 13-15
  zooid width: 19-13

Ascopore (lime green shading, black lines):
 Shape: area
 Position to operculum: proximal-distal position
  position to operculum (right side): 1-7
  position to operculum (left side): 1-8
 Position to side wall: relative position
  position to right side wall: 19-1
  position to left side wall: 13-1

Avicularia (purple shading, grey lines):
 Shape:
  length: 2-5
  height: 3-4
  area
 Position to operculum: proximal-distal position
  position to operculum (left side): 4-8
  position to operculum (right side): 4-7
 Position to side wall: relative position
  position to left wall: 13-5
  position to right wall: 19-2

So from what I can gather, the points 1-22 in the Readme figure are as follows:
Autozooid landmarks on Readme image :
1: marks the center of the ascopore
2: If "position to right wall: 19-2" then 2 marks the avivulariums edge to the zooids "right" (from the image orientation, but the zooids left if proximal end is "up"?) In cases where there are two avicularia, then maybe left/right markers are easier if you want to compare the form of the two avicularia than medial/lateral side markers? In that case 2 on the readme image is the medial edge of the avicularium. Maybe you want to be able to know if the avicularium is on the left or right side of the zooid in addition to the length and width? If the length between point 2 and 5 is what is important, then maybe it is not as important to be consistent with whether point 2 or point 5 is the left side? Maybe you want to be able to know if the avicularium is on the left or right side of the zooid in addition to the length and width? (Maybe this level of detail is not important, but it might be).
3: the edge of the avicularium that faces the zooids proximal end. (The orientation of the avicularia on the zooid might vary between zooids and species?) If the avicularia measurements are separated out then maybe it's better to orient these landmarks points along the the aviculariums own axis as this may be different than that of the zooid?
4: the distal end of the avicularium.
5: the end of the avicularim opposite point 2.
6: the midpoint on the distal end of the operculum.
7 and 8: the lateral corners of the operculum.
9: the midpoint on the proximal end of the autozooid.
10 and 22 mark the connection point to other zooids but in fossils where the junction point is eroded or the zooid is alone these landmarks might be used to span the autozooids width at its proximal edge.
11 and 12 are midpoints between 10 and 13.
13 and 19 mark the edge of this zooid that is closest to the junction point with other zooids (not necessarily the zooids widest part, but in a lot of the fossils, the zooid is alone or the connection points are very unclear, so the widest part might be a stand in in those cases).
14 is point on the zooid edge that is in line with the lower edge of the operculum.
15 is at the distal right side junction with other zooids.
16 is the middle of the distal end
17 is the left side distal junction
18 is level with the operculums proximal edge.
19 is the left junction point with other zooids.
20 and 21 are midpoints between 19 and 22.
22 is the junction with other zooids on the left proximal end.

metadata

Discrepancy between BLEED database (information about specimens) and Voucher (image metadata):

  • 1144A
  • 640B
  • 2119
  • 2120
  • 74

about ML

Contours can be defined as the curves or outlines that represent the boundaries of objects or shapes within an image. These curves join all the continuous points (along the boundary) having the same color or intensity, highlighting the structural properties of objects and providing a way to extract and represent shape information from images.

The contours are used to define the mask

element is to state the condition of a pixel (i.e., 1 or 0; black or white) (see here). Morphological operations “probe” an image with a structuring element. This structuring element defines the neighborhood to be examined around each pixel. And based on the given operation and the size of the structuring element we are able to adjust our output image (from here). That is, we can ask for pixels that are similar to the one we are looking at.

The bbox is a rectangle around the mask
d1 and d2 are automatically extracted using cv2 by creating an rectangle, or bbox
xc, yc are centroids of the rectangle drawn using mask_util.toBbox(), where the bbox is around the mask

cX and cY are centroid of the mask (not the rectangle around the mask)

all outputs are floats

bbox always comes out as (top, left) and (bottom, right)

ML workflow

  1. Match images to their metadata by running "metadata_workflow.R"
  2. Create a folder of images
    • name the folder with "-jpg" at end
    • Move all files (.txt and .tif)
    • Remove all files with ending ".txt" by
      • cd to directory
      • rm *.txt
  3. Convert to jpg
    • cd to folder
    • for f in *.tif; do  echo "Converting $f"; convert "$f"  "$(basename "$f" .tif).jpg"; done
    • rm *.tif
  4. Run DeepBryo for Microporella
    conda activate deepbryo_micro
    pip3 install openmim
    mim install mmcv-full==1.4.0
    #git clone https://github.com/agporto/DeepBryo.git
    #cd DeepBryo_micro
    pip3 install -e .```
    - `cd app && streamlit run app.py --server.port 8080`
    - the app can be accessed through the web browser at: localhost:8080
    
  5. Run ML-morph for Microporella
  6. View images and landmarks
    • ./imglab output.xml
      • click + press "i" to ignore
      • MUST SAVE AS NEW FILE TO RETAIN CHANGES!!!!
    • Save as a csv
      • python
      • from utils import dlib_xml_to_pandas
        • ignore apex is not installed
      • dlib_xml_to_pandas('output.xml')
        • must have ".xml" ending
      • quit()

tasks

  • make list of images to use using metadata
  • play around with parameters to filter out zooid ahead of time
  • make code to match autozooids with avicularia and operculum (give them same id)
  • write code to extract linear traits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.