These are chat archives for fiji/fiji

2nd
May 2018
Varun Kapoor
@kapoorlab
May 02 2018 08:50
Hi fiji, does anyone knows how to make a contour plot using jfreechart?
Varun Kapoor
@kapoorlab
May 02 2018 12:54
@imagejan That does work Contour plot but not really an eye candy plot that IDL would give, anyhow, is there an interpolation function built for such a R(x,y) data where I fill in the missing R values between the (x,y) co-ordinates by doing a spline interpolation or do I have to write such a function myself if it does not exist out there?
Jan Eglinger
@imagejan
May 02 2018 13:11
Does it have to be JFreeChart? I'd go and use ggplot2 in R (preferably via KNIME, because I can chain together image analysis and plotting), or do something with plot.ly ...
Varun Kapoor
@kapoorlab
May 02 2018 13:13
Yeah probably I would do that too, JFreeChart is just to get an immediate output visualization from the program but for serious analysis ggplot2 sounds better, thanks.
Jan Eglinger
@imagejan
May 02 2018 13:13
@kapoorlab what are you trying to achieve? Plotting curvature vs xy coordinates doesn't really ask for a contour plot, does it?
Varun Kapoor
@kapoorlab
May 02 2018 13:37
The curvature is computed for each xy co-ordinate, it is a local curvature along the curve for which i use the curvature formula of second and first derivatives taking in 3 points spaced at a distance delta to get the curvature value at the central point. The height at the (x,y) is the curvature at that point and that becomes the color in the contour, right or?
Jan Eglinger
@imagejan
May 02 2018 13:42
Alright, so you want contour plot with equipotential lines? Or would a 2d density plot do as well?
Varun Kapoor
@kapoorlab
May 02 2018 14:05
No, no equipotential lines I need here, a
But instead of a density plot I would still go for contour with just color coding which is convenient coz that can be overlayed on the cell boundary and produce a more intiutive picture of local curvature variation
Jan Eglinger
@imagejan
May 02 2018 14:19
I still don't get it. For a contour plot, you'll need data points for every x,y coordinate on your grid. But you only have sparse data for the cell boundary, no? Did I completely misunderstand your case?
Varun Kapoor
@kapoorlab
May 02 2018 15:50
No that is right, only sparse data from the boundary and then I overlay a contour plot along the boundary with color representing high and low curvature points along the boundary pixels.
Jan Eglinger
@imagejan
May 02 2018 15:50
That's not a contour plot.
Philipp Hanslovsky
@hanslovsky
May 02 2018 15:51
Sounds more like a scatter plot to me.
Varun Kapoor
@kapoorlab
May 02 2018 16:02
But the color is the measure of weak or strong curvature, the curvature plot is on the grid of the boundary
Coordinates, so we need the color there to represent curvature
Philipp Hanslovsky
@hanslovsky
May 02 2018 16:05
I am not familiar with java plotting tools but matplotlib.pyplot.scatter does exactly what you need for the Python world. So my best guess would to look for scatter plots in your Java plotting library
matplotlib.pyplot.scatter( x=x_coordinates, y=y_coordinates, c=color_coding)
or, if you don't want to create your own color coding, you could pass something like this:
matplotlib.pyplot.scatter( x=x_coordinates, y=y_coordinates, c=curvature, cmap=color_map)
Varun Kapoor
@kapoorlab
May 02 2018 16:25
in java you can do something basic to make a color map like that but what I also want it to do is to interpolate the missing values to produce a continuous curve from discrete boundary points, but this does not has to be strictly done in java but any external plot program is also ok, even Matlab for this part would be acceptable.
Curtis Rueden
@ctrueden
May 02 2018 17:14
Heads up to everyone using Travis CI: they are combining travis-ci.org and travis-ci.com. This is a good thing. Unfortunately, they chose travis-ci.com as the One True Domain Name (TM). So we'll have to reauth Travis on the travis-ci.com site. Things will transition over the next months.
Philipp Hanslovsky
@hanslovsky
May 02 2018 17:22
@kapoorlab I am not aware of any plotting library that can do that.
I would probably try to use kdtrees to store the sample points, then create a FunctionRealRandomAccessible that does a lookup for nearest neighbors in the kd-tree (and interpolates the result), and then apply a convert to transfer it into some color space.
Philipp Hanslovsky
@hanslovsky
May 02 2018 17:27
If there are no gaps between your sample points, you could just create an image that is NaN everywhere except at the sample points, and then just linearly interpolate. You would need to create an InterpolatorFactory that ignores NaN though.
Varun Kapoor
@kapoorlab
May 02 2018 17:50
Yeah i c, the sample points I create out of the boundary points will always have gaps as for computing local curvature from three points i need to create points that are separated by some delta, else i will be calculating curvature of a locally flat region. In the end I will get a bunch of discrete points with curvature values associated to them and then using a KDtree I can interpolate the value between nearest points without making an image of Nan, i will try this, thanks.
Varun Kapoor
@kapoorlab
May 02 2018 19:18
@hanslovsky In the end it seems making a PointSampleList of Curvature values and then interpolating it would be the step to be done before putting it in any plot program.
Philipp Hanslovsky
@hanslovsky
May 02 2018 19:19
:plus1: