Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example data for multiple image stacks #32

Open
a19s opened this issue Apr 20, 2021 · 1 comment
Open

Example data for multiple image stacks #32

a19s opened this issue Apr 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@a19s
Copy link
Collaborator

a19s commented Apr 20, 2021

I tried using a Path object from pathlib to automate a folder analysis, and it seems that load_data() doesn't work with Path objects (at least on Windows). Code:

pix_per_um = 1.0 / 0.1018971 
E = 3000 

p = Path('../data/')

dir = p / 'cells' / '1kPa'
refs = set(dir .glob('*_ref.tif'))
imgs = set(dir .glob('*.tif')) - refs
dataset = list(zip(sorted(imgs), sorted(refs)))

traction_obj = TractionForce(pix_per_um, E=E)

for img_path, ref_path in dataset:
    img, ref, _ = traction_obj.load_data(img_path, ref_path)

Raises:
RuntimeWarning: Please ensure that the input image has shape (f,c,w,h) the current shape is (1088, 1590)

This is (at least temporarily) solved by changing the last line to:
img, ref, _ = traction_obj.load_data(str(img_path), str(ref_path))

@a19s a19s added the enhancement New feature or request label Apr 20, 2021
@rg314 rg314 changed the title TractionForce.load_data() does not work with Path objects Example data for multiple image stacks Apr 20, 2021
@rg314
Copy link
Owner

rg314 commented Apr 20, 2021

Hi Andrea, I've updated the naming of this issue to demonstrate an example usage of multiple image stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants