wingtorres / morphometrix Goto Github PK
View Code? Open in Web Editor NEWA PyQt5 Gui for photogrammetry and morphometry
License: MIT License
A PyQt5 Gui for photogrammetry and morphometry
License: MIT License
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:
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
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.
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!
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]
Operating System: Windows 11
Chip (e.g. x86-64, Mac M1):
Python version: 3.10
Mark inside the brackets with an [x] to
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!
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.
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
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
Check Bezier and measure TL with > 2 points
- Executes width measuring functionality as expected
@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?
Operating System: Windows 11
Chip (e.g. x86-64, Mac M1):
Python version: 3.10
Mark inside the brackets with an [x] to
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!
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.
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.
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'
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
Operating System: Windows 11
Chip: Intel(R) Core(TM) i7-8550U
Python version: 3.10.8
Mark inside the brackets with an [x] to
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
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.
Hi Walter!
Thanks to you and KC so much for all your work on this incredibly useful package. A few things:
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
Mark inside the brackets with an [x] to
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.