Coder Social home page Coder Social logo

celltool's People

Contributors

leekamentsky avatar zpincus avatar

Stargazers

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

Watchers

 avatar  avatar

celltool's Issues

Issue with measure_contours --integrate-image

Hi @zpincus,

I am trying to measure the intensity along a centerline contour, which I have in the pathway Mg1655/Mg1655_Centerlines. Within the same pathway I also have my image files to be analyzed. They are named appropriately (ie. contours: Mg1655-01-01.contour images: Mg1655-01.tif, etc.) and I was able to run this image swath code:
celltool measure_contours Mg1655/Mg1655_Centerlines/Mg1655*.contour --output-file="LineScansMg1655.csv" --image-swath Mg1655/Mg1655_Centerlines/Mg1655-*.tif

However, when I replace the option "--image-swath" with "--integrate-image", I receive "NotImplementedError"

celltool measure_contours Mg1655/Mg1655_Centerlines/Mg1655*.contour --integrate-image Mg1655/Mg1655_Centerlines/Mg1655*.tif

Issue with the coordinate convention

Hey

In numpy images are represented by the ij indexing that is top left corner is the origin. But i assume that warping should consider cartesian coordinates. How do you ensure that. In np.mgrid isnt the origin at the top left too. I am confused about the issue of origin and the coordinate system in numpy and in biomedical imaging because i believe in itk the origin is specified as 0, 0. How do we take care of this issue here

Unable to use image wrap function

Hi @zpincus ,
I'm trying to run your warp_images function and I'm confused what to pass as "output region". I'm passing the following tuple but getting a "invalid shape for coordinate array" error.
tuple - (0, 0, image.shape[0], image.shape[1])
Error -
Traceback (most recent call last):
File "wrap2.py", line 117, in
print(warp_images(from_points, to_points, [image], (0, 0, image.shape[0], image.shape[1])))
File "wrap2.py", line 26, in warp_images
return ndimage.map_coordinates(numpy.asarray(image), transform, order=interpolation_order)
File "/home/ritika/anaconda3/envs/shipmnts/lib/python3.7/site-packages/scipy/ndimage/interpolation.py", line 341, in map_coordinates
raise RuntimeError('invalid shape for coordinate array')
RuntimeError: invalid shape for coordinate array

Python 3.x: integer division results in float (PEP 238)

In Python 3.x, image_warp yields the following error:

.../python3.6/site-packages/celltool/numerics/image_warp.py in _make_inverse_warp(from_points, to_points, output_region, approximate_grid)
     55         iy1 = (y_indices+1).clip(0, y_steps-1)
     56         t00 = transform[0][(x_indices, y_indices)]
---> 57         t01 = transform[0][(x_indices, iy1)]
     58         t10 = transform[0][(ix1, y_indices)]
     59         t11 = transform[0][(ix1, iy1)]

IndexError: arrays used as indices must be of integer (or boolean) type

This is an unfortunate consequence of PEP 238 applied to the following location: https://github.com/zpincus/celltool/blob/master/celltool/numerics/image_warp.py#L37
I will submit a pull request shortly.

Warping arbitrary x-y coordinates

Hi @zpincus, I discovered your unwarping code (warp_images) through this forum post by Stéfan van der Walt today. It saved me days of struggle!

I had a follow-up question (just below that post) which I thought I'd just bring up with you directly here too. Having defined a transform through your function I now want to transform an array of x-y coordinates (nx2) from the original space into the warped space. How do I do that?

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.