ronshnapp / myptv Goto Github PK
View Code? Open in Web Editor NEWMyPTV is an open source library designed for 3D particle Tracking (3D-PTV) measurements
License: MIT License
MyPTV is an open source library designed for 3D particle Tracking (3D-PTV) measurements
License: MIT License
Testing the dilation
segmentation method with otherwise default values throws NameError. Particle_size may not be extracted correctly from the params_file.yml
?
Operating System: Windows 10
Python Version: Miniconda3 Conda 4.12.0 Python 3.9.7
Parameters:
- segmentation:
Number_of_images: 1
images_folder: Calibration
single_image_name: cal2.tif
image_extension: '.tif'
mask: 1.0
ROI: 227, 1050, 120, 920
plot_result: True
threshold: 42
median: 5
blur_sigma: None
local_filter: None
min_xsize: 1.0
min_ysize: 1.0
min_mass: 60.0
max_xsize: 15.0
max_ysize: 15.0
max_mass: None
method: dilation
particle_size: 8
save_name: None
Error:
Traceback (most recent call last):
File "MyPTV\example\workflow.py", line 719, in <module>
wf = workflow(fname, action)
File "MyPTV\example\workflow.py", line 76, in __init__
self.do_segmentation()
File "MyPTV\example\workflow.py", line 429, in do_segmentation
if method=='dilation' and type(particle_size) != int:
NameError: name 'particle_size' is not defined
feature request: add python script for image preprocessing, specifically the background subtraction to the workflow
When doing stitching step after 2D_tracking steps, error comes out as:
given inputs -
params file name: params_file.yml
action: stitching
starting at 60 trajectories
with 63.7 samples per trajectory on average
searching for candidates to connect:
Traceback (most recent call last):
File "workflow.py", line 1028, in
wf = workflow(fname, action)
File "workflow.py", line 93, in init
self.do_stitching()
File "workflow.py", line 926, in do_stitching
ts.stitch_trajectories()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 368, in stitch_trajectories
self.calc_dij()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 161, in calc_dij
v = gradient(x, axis=0)
File "<array_function internals>", line 6, in gradient
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 1065, in gradient
"Shape of array too small to calculate a numerical gradient, "
ValueError: Shape of array too small to calculate a numerical gradient, at least (edge_order + 1) elements are required.
I guess it may relate to the disagreement between 3D and 2D stitching or improper setting parameters. Here I set them as:
stitching:
trajectory_file: trajectories_2D
max_time_separation: 3
max_distance: 5
save_name: trajecotries_stitched
I installed the package and ran all the workflow.py
related options in the examples folder, but then I wanted to see some animations of particles flying around but the examples dried up. You've done a great job of explaining the details of the package in the user_guide
but I was hoping for a higher-level demonstration of the whole package. Like an example that takes the calibration and other outputs from workflow.py
and actually does something with them, like just the bare basics. The user guide can then elaborate on the how and why of each step. This is not a requirement for publication, just a suggestion as a very newbie user. In other words, in the readme you say do from myptv import imaging_mod
to start using the package, but no further explanations, which seems like you left me hanging.
Line 568 in 29c3a35
I'll consolidate my feedback on the JOSS software paper here. Overall, I'm excited about this software and have primarily minor comments on the paper.
Major:
Minor:
Typos:
When I installed MyPTV and run its tests, 5 tests passed, but test_segmentation test failed with TypeError
This is a fresh system with Ubuntu 20.04
I made sure to only install python3 and pip3, without python2 packages.
Error (see error1.txt
for more context):
> i0 = (self.image_start is not None) * self.image_start
E TypeError: unsupported operand type(s) for *: 'bool' and 'NoneType'
myptv/segmentation_mod.py:458: TypeError
The commands I executed, in order:
git clone
cd MyPTV/
pip --version
pip install .
sudo apt install python3-pytest
pytest-3 ./tests/ -W ignore:RuntimeWarning
pytest-3 .
Output of pytest-3 .
error1.txt
Versions:
:~/projects/MyPTV$ python3 --version
Python 3.8.10
~/projects/MyPTV$ pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
~/projects/MyPTV$ pytest-3 --version
This is pytest version 4.6.9, imported from /usr/lib/python3/dist-packages/pytest.py
It's not clear what the purpose of the folder is from the user manual. Some of the data also appears to be a different format than that in the example/calibration
folder, if this is an old calibration procedure it's likely best to remove to avoid confusing users. If it's part of a test case maybe it should move out of the main directory?
I'd like to open this is a new project and together implement the dumbbell calibration and fiber tracking - both are built on the two-point object ideas
Is there any particular reason that your installation instructions require download source code and running pip? Why not post the package to pip and/or conda-forge?
I'm going to consolidate a few typos in the user manual into this issue, focusing on those that could confuse a user:
workfolw.py
instead of workflow.py
I don't think a user would misunderstand, but given it's the core script for running the code it's worth fixing(myptv) PS C:\Users\alex\repos\test_cavity_myptv\example> python ../myptv/example/workflow.py .\params_file.yml matching
given inputs -
params file name: .\params_file.yml
action: matching
Starting stereo-matching.
Traceback (most recent call last):
File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 623, in <module>
wf = workflow(fname, action)
File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 75, in __init__
self.do_matching()
File "C:\Users\alex\repos\test_cavity_myptv\myptv\example\workflow.py", line 480, in do_matching
mbf.get_particles(frames=frames)
File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\myptv\particle_matching_mod.py", line 161, in get_particles
itm = initiate_time_matching(self.imsys, pd, pd1,
File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\myptv\particle_matching_mod.py", line 713, in __init__
self.trees[k] = KDTree(self.pd1[k])
File "C:\Users\alex\miniconda3\envs\myptv\lib\site-packages\scipy\spatial\_kdtree.py", line 343, in __init__
super().__init__(data, leafsize, compact_nodes, copy_data,
File "_ckdtree.pyx", line 567, in scipy.spatial._ckdtree.cKDTree.__init__
ValueError: data must be 2 dimensions
After a fresh install, I ran the initial_calibration command of workflow.py and tried to use +/- to zoom.
The following error appeared:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\admin_user\.pyenv\pyenv-win\versions\3.11.5\Lib\tkinter\__init__.py", line 1948, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "D:\MyPTV\Test-Project\.venv\Lib\site-packages\myptv\gui_intial_cal.py", line 792, in zoomIn
Image.ANTIALIAS)
^^^^^^^^^^^^^^^
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'
I could get around this issue by downgrading my Pillow to 9.5.0, since in 10.0.0 some attributes were deprecated. But still, probably worth fixing, or else putting the pillow version in the install guide.
@ronshnapp it would be great if we consider a few things that will make all the adoption easier:
The manual suggests creating an empty file and starting iterations of 1-2 in the calibration, but this process does not converge to anything useful for the cam1 in /example. I suggest adding some explanation on how to create a reasonable initial guess or providing some file that a user can iterate 3-5 times and reach some result.
please add a link to the script that generates visualization of the results:
Hello! I'm trying to understand the rotation angles for calibration. In Figure 5, should the rotation vector for b) be (-1/4pi, -3/4pi, 0) instead of (-1/2pi, -3/4pi, 0)? Or perhaps let me know if I am misunderstanding the transformation. Thanks!
The purpose of the legacy_calibration_example
folder in the example
folder isn't clear (not mentioned in user manual). Since you recommend copying this directory structure for a new experiment, should this folder be removed or explained?
To keep the example directory cleaner (as a better template), you could remove .ipynb_checkpoints.
You could add .ipynb_checkpoints
to .gitignore
so that they won't be pushed.
https://github.com/ronshnapp/MyPTV/blob/master/dist/git%20clone%20git%40bitbucket.org:ronshnapp-.txt
I think it's better to remove the unnecessary folders and add them to .gitignore
so they do not disrupt the source history
dist
.eggs
myptv.egg-info
and in user_manual
to remove LaTeX working files: .bib
, .bak
, .out
and others. leave only .tex
, .bib
and figures :)
I'm going to consolidate a couple small documentation issues related to the calibration section (2.2) of the user manual here.
Acceptance blockers:
Other:
calibration_points_gui
workflow option is mentioned in 2.2 Calibration guide, but not in 2.1.1 The workflow.py script, which only lists 7 options for the workflow command. Please also check for other hidden workflow options and include a complete list in 2.1.1.example
folder has more than 6 points for each camera for this step (maybe say "at least 6 points" in the docs?)OS: Windows 10
Python Version: Miniconda3 Conda 4.12.0 Python 3.9.7
The conda
installation directions are missing a minor step after setting up the conda environment. myptv
imports in the root folder and the tests run but myptv
will not import in the example
folder (to run the example workflow) unless installed after setting up the conda environment (e.g. using pip
or setup.py
). The directions should include this step for completeness.
`(myptv) PS C:\Users\alex\repos\MyPTV\example> python workflow.py params_file.yml calibration
given inputs -
params file name: params_file.yml
action: calibration
camera files not detected in the working directory.
Generating a new empty file and leaving calib. sequence.
To continue calibration, fill in an initial guess in the
empty file, and then run again the calibration sequence.
Traceback (most recent call last):
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 575, in
wf = workflow(fname, action)
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 63, in init
self.calibration_sequence()
File "C:\Users\alex\repos\MyPTV\example\workflow.py", line 261, in calibration_sequence
cam.save('.')
UnboundLocalError: local variable 'cam' referenced before assignment`
The "Who manages this project?" section of the Readme covers some, but not all, of the JOSS requirements ("Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support").
Please add/expand guidelines, especially for reporting issues and seeking support.
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.