Code Monkey home page Code Monkey logo

morphometrix's People

Contributors

cbirdferrer avatar wingtorres avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

morphometrix's Issues

Inaccuracy measuring diagonal w/ Bezier ON

I'm using the updated version of the code that Clara Bird helped with where the Bezier curve is not applied to a measurement line with only two points, even if it is selected ON. In other words, the Bezier curve is applied only to a measurement with 3 or more points, whether it is check ON or OFF.

There seems to be inaccuracy when an straight object is measured on a diagonal line as opposed to horizontal or vertical.

I did a test where I measured a A) horizontal, B) vertical, and C) diagonal line four times:

  1. Bezier ON w/ 2 pts in line
  2. Bezier OFF w/ 2 pts in line
  3. Bezier ON w/ 3 pts in line
  4. Bezier OFF w/ 3 pts in line

In this test, the actual measurement doesn't matter, just that the result are the same for each of the four measurements for horizontal, vertical, and diagonal.

For the horizontal and vertical lines, each of the four measurements (2 and 3 pts in line) were essentially identical (within 0.01). However, for the diagonal line, all were identical except measurement 3) "Bezier ON w/ 3 pts", which was larger (5.41 instead of 5.11) . So, it appears that the Bezier line may be affected by the angle of the measurement line relative to the pixels, with 45 degrees in theory having the potential for the greatest difference.

Is there a way to fix this so that the Bezier curve does not add error to the measurement when at a diagonal?

I attached is an image and MorphoMetriX output for horizontal, vertical, and diagonal measurements.

Thanks!
KC

Diagonal_Measurement_Inaccuracy-measurements
Diagonal_Measurement_Inaccuracy.csv
Diagonal_Measurement_Inaccuracy

Number of Width Segments

Using the new code with the "Matrix representation of Bezier curves" (main.py), the "# Width Segments" now corresponds to the actual number of width lines drawn rather than the number of segments the animal is divided into. Setting the # of Width Segments to 20 now divides the animal into 21 segments.
Screen Shot 2022-06-06 at 6 55 33 PM

More text to orient user on home screen

It's a bit cumbersome to toggle between the paper/README/GUI to keep track of each of the steps. Please consider adding some text, each on hover, on in the sidebar that helps guide the user. I think this would reduce the barrier to entry.
Thanks!

Width measuring lines below image

I'm using MorphoMetriX_V3_test_220122.py on a macbook pro running macOS Monterey 12.1

Once you have loaded an image, if you 'measure' the whale from the bottom of the picture to the top of the picture using 'Measure Lengths', and then hit 'Measure Widths' the measure lines are below the image - it works correctly if you measure from the top to the bottom

Attached an image showing this

Feel free to contact me for any more info.

Charlotte Dunn
[email protected]
Screenshot 2022-02-04 at 8 44 35 AM

Another look at v2

System Information

Operating System: Windows 11
Chip (e.g. x86-64, Mac M1):
Python version: 3.10

Verify that you can carry out the following actions

Mark inside the brackets with an [x] to

  • [ x] Measure a length w/ Bezier curve
  • [ x] Measure a length w/o Bezier curve
  • [ x] Measure width segments w/ Bezier curve
  • [ x] Measure width segments w/o Bezier curve
  • [ x] Measure an angle
  • [ x] Measure an area
  • [ x] Export measurements saves a .csv and .png w/ the correct measurements

If you encounter an error, please copy paste the error log info here. Attach the .csv/.png to the issue if possible.

Please provide additional feedback and/or suggestions below

I already provided feedback few days before, but I just realized something else as I was using this version. When measuring widths on narrower body parts of an animal (specifically a dolphin), the crosshair from one side obscures the body contour of the other side. It'd be great to have the option to change the size of the crosshair to avoid it being in the way of measurements.
Thank you again very much for your work!

Issues Measuring Widths

I'm using development code updated for PyQt6 (running on 2021 Macbook Pro with M1 Pro in native arm64 - OS 12.0.1 Monterey) and noticed an issue with measuring widths related to the Bezier Fit function - the three scenarios / behaviors are described below - all were done with 20 percentile width segments.

  1. Uncheck Bezier checkbox and measure TL with two points, double clicking second point to finish the measurement:
    - Measure Widths option button greyed out and not selectable

  2. Check Bezier (default when opening program) and measure TL with two points
    - Measure Widths option button is clickable, but clicking it crashes Python with the following Traceback:
    Traceback (most recent call last):
    File "/Users/eihwood/Morphs/morphometrix/morphometrix/main.py", line 707, in measure_widths
    self.slopes = self.m[:,self.inddec]
    TypeError: 'NoneType' object is not subscriptable
    zsh: abort python -m morphometrix

  3. Check Bezier and measure TL with > 2 points
    - Executes width measuring functionality as expected

MorphoMetriX crashes

@wingtorres I am facing an issue that seems to have been mentioned before.
I installed everything as indicated and I can successfully open the GUI and charge an image.
I can select "Measure Length", draw the line, but when I select "Measure Widths", MorphoMetriX crashes with the following error / traceback:
Traceback (most recent call last):
File "C:\Users\Agathe\Documents\morphometrix\morphometrix_main_.py", line 746, in measure_widths
t_i = np.array([root_scalar(gauss_legendre, x0 = s_i, bracket = [-1,1], method = "bisect",
File "C:\Users\Agathe\Documents\morphometrix\morphometrix_main_.py", line 747, in
args = (bezier, self.Q, self.kb-1, True, s, self.l) ).root for s in s_i])
AttributeError: 'imwin' object has no attribute 'Q'

Could you please help me with this issue?

Very nice updates!

System Information

Operating System: Windows 11
Chip (e.g. x86-64, Mac M1):
Python version: 3.10

Verify that you can carry out the following actions

Mark inside the brackets with an [x] to

  • Measure a length w/ Bezier curve
  • Measure a length w/o Bezier curve
  • Measure width segments w/ Bezier curve
  • Measure width segments w/o Bezier curve
  • Measure an angle
  • Measure an area
  • Export measurements saves a .csv and .png w/ the correct measurements

If you encounter an error, please copy paste the error log info here. Attach the .csv/.png to the issue if possible.

Please provide additional feedback and/or suggestions below

Hey thank you so much for your work! It's a really nice upgrade. I love the option of having a mirror side. It really helps with more difficult pictures. My only suggestion is with regard the mirror side option. It would be great if when you select a point on the side that you decide to mirror (for example A), you could also see the crosshair from the opposite side (in this case the B side) to move in the picture. I like that it would also give you a visual check to see how the mirror side option performs with good pictures.

Lastly, I tried to use the .csv file extracted using the MorphoMetriX v2 to also obtain body area index using the first version of collatrix. However, the that version of collatrix doesn't seem to select or recognize the new .csv file produced by MorphoMetriX v2. Would it be possible to make it compatible?

Thank you for giving me the chance to test this program. I found the installation without command line very efficient and easy. It saves me tons of time to install it into the laptops of research assistants and others!

Allow user to change size of width lines/dots

This is definitely more of a feature enhancement than a bug, but it would be nice to adjust the size of the lines/dots when measuring width. They're pretty small as is, so it could be good to add a slider or other option for someone to adjust the size.

Also, if you want others to contribute, adding a CONTRIBUTING.MD or "how to add an issue" doc could be helpful.

Distribute via conda-forge

Rather than using a personal channel, eventually it would be good to have the MorphoMetrix package distributed via conda-forge. Some changes need to be made to the meta.yaml file following the conda-forge docs and referencing the example.

  • use url instead of git_url
  • add sha256 checksum
  • script: "{{ PYTHON }} -m pip install . -vv" instead of python setup.py
  • add tests - this can be just testing the imports
  • add description

Crashing when measuring angle

When I try to measure an angle in morphometrix, after I specify the name of the angle I'm measuring, the software crashes and the following error message pops up in Windows PowerShell:

js: Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'.
Traceback (most recent call last):
File "C:\Users\DavidSweeney\Documents\UAS\morphometrix-master\morphometrix_main_.py", line 339, in measure_angle
QApplication.setOverrideCursor(QtCore.Qt.CrossCursor) #change cursor
^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Qt' has no attribute 'CrossCursor'

Unable to use the pan function

I am using the updated version of MorphoMetriX, but I am unable to use the 'Shift' key to navigate the image. Instead, I have to zoom in and then zoom out to then zoom in again in a different area. I'm trying my best to be accurate when measuring, but with no way to precisely maneuver along the image, it is difficult. Is there a way to fix this?
Thanks!
Abby

MorphoMetrix version 2 beta testing

System Information

Operating System: Windows 11
Chip: Intel(R) Core(TM) i7-8550U
Python version: 3.10.8

Verify that you can carry out the following actions

Mark inside the brackets with an [x] to

  • Measure a length w/ Bezier curve
  • Measure a length w/o Bezier curve
  • Measure width segments w/ Bezier curve
  • Measure width segments w/o Bezier curve
  • Measure an angle
  • Measure an area
  • Export measurements saves a .csv and .png w/ the correct measurements

If you encounter an error, please copy paste the error log info here. Attach the .csv/.png to the issue if possible.

Piecewise length measurement error log
System: Windows
OS: nt
Python Version: 3.10.8
Python Implementation: CPython
Release: 10
Version: 10.0.22621
Machine: AMD64
Processor: Intel64 Family 6 Model 142 Stepping 10, GenuineIntel

Traceback (most recent call last):
File "morphometrix_main_.py", line 437, in export_measurements
TypeError: can't multiply sequence by non-int of type 'float'

210716_I2O_S5_U2_DJI0005_00_02_45_vlc00009.csv

Please provide additional feedback and/or suggestions below

A couple of times I tried to click the undo button (to undo the second point placement of the Bezier curve length measurement and to undo moving a crosshair for the width measurement) but it did not seem to undo the move. It did work when I was doing a Piecewise measurement and I clicked undo mid-measurement.

When I measure the length with Piecewise selected it allows me to make the measurement but when I double click to end the measurement, although it ends the line, the bottom left still says "Click to place next point" and the Measure Width button is grayed out. When I click export after making the Piecewise length measurement MorphoMetrix crashes (log and csv above).

When I tried to do a Piecewise length measurement directly following a Bezier curve measurement (i.e. same window) I can successfully export the measurements without it crashing but the measurement appeared as "nan" in the csv output.

Installation Issues

Hi Walter!

Thanks to you and KC so much for all your work on this incredibly useful package. A few things:

  1. I am working on my mac mini (2018) with intel processor with OS12.3.1 Monterey (I also have a macbook pro arm64)
  2. I am conducting a fresh install on my work computer to get the bug fixes and a few questions came up - mostly having to do with installation instructions and documentation.
  3. My process is briefly - a) latest installation of miniconda in /Users//opt/miniconda and b) creation of lightweight env - conda create --no-default-packages -n morphometrix pip, c) but when I go to install morphometrix using conda-forge -c wingtorres -n morphometrix python morphometrix=1.0.2 and then run "python -m morphometrix" I get complaints about
  4. No module named 'PyQt5.QtWebEngineWidgets'... which is strange because my understanding was that you migrated all to PyQt6... starting MorphoMetriX also fails after I attempt to pip install PyQt5 and PyQtWebEngine...
  5. Perhaps the only source code that works is the devtools version installed with 'git clone https://github.com/wingtorres/morphometrix.git' into my /Users//morphs directory? This works, though in addition to pip install PyQt6 PyQt6-WebEngine numpy I also have to pip install scipy which isn't in your documentation. Curious what is going on there? It might help users to update the installation instructions on the github page if you have time :) TY!!!
  6. Ok, so then using the git clone installed version I can open up MorphoMetriX and load an image. However, that same Bezier functionality issue we were having last December is either back or hasn't been solved. I will respond in that Issues thread so it is not mixed in with the above installation issues.

Beta version 1.2.0 testing

System Information

Operating System (e.g. Mac OS Monterey, Windows 11, Ubuntu Lunar Lobster): Windows 11
Chip (e.g. x86-64, Mac M1): 64
Python version: 3.10.8

I used the windows exe app for testing

Verify that you can carry out the following actions

Mark inside the brackets with an [x] to

  • [x ] Measure a length w/ Bezier curve
  • [see feedback below] Measure a length w/o Bezier curve
  • [x ] Measure width segments w/ Bezier curve
  • [see feedback below] Measure width segments w/o Bezier curve
  • Measure an angle
  • Measure an area
  • [see error] Export measurements saves a .csv and .png w/ the correct measurements

If you encounter an error, please copy paste the error log info here. Attach the .csv/.png to the issue if possible.

Exporting worked fine with the exception of when exporting length measurements that did not include a bezier fit length. Put another way to help clarify the conditions that throw errors, if a piecewise length measurement was made but no bezier fit length is made, the attached error would be spit out, the measurements csv file would only contain metadata, and no measurement image would be returned. However, if piecewise and bezier fit lines are made, or if no lengths are made and just angles and/or areas are made, exporting data works fine.
2023-06-28_Morphometrix_Crashlog.txt
210716_I2O_S5_U2_DJI0005_00_02_45_vlc00009.csv

Please provide additional feedback and/or suggestions below

  • When measuring piecewise lengths, nan values are returned for lengths regardless of how many segments make up the piecewise length.
  • If both a bezier fit and a piecewise line have been made, width measurements will always pop up for the most recent bezier fit. For example, if I make 3 piecewise lengths and 7 bezier fit lengths, measured widths will only pop up for the 7th bezier fit curve regardless of what length was created last.
  • measure widths points only can appear for piecewise lines with one segment (this makes sense somewhat but there may be a benefit of making this more flexible)
  • width segments for piecewise lines are not accurately spaced across the length of the line

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.