Re: [micro-manager-general] Spam (12.588):Re: Steps to get a functional plugin, lesson n+1
Status: Beta
Brought to you by:
nicost
|
From: Carlos G M. <tr...@ac...> - 2020-04-09 20:27:00
|
Allmost there.
I've have steps 1, 2 & 3 working, but for a minor thing: intensity
values are not right.
I was hoping to use ImageJ stuff to do the calculations (so it is easy
to update, upgrade, whatever) but as noted in another message, the
liaison is complicated...
My point drawing code now looks like:
@Subscribe
public void onNewImage(DataProviderHasNewImageEvent event) {
imagesReceived_++;
if (skip_ != 0 && imagesReceived_ % (skip_+1) != 1)
return; // 1Hz max
double v;
title.setText("You should be seeing data on the plot.");
image_ = studio_.displays().getAllImageWindows().get(0).getImagePlus();
for (int i = 0; i < ROIs_-1; i++) {
image_.getProcessor().setRoi(roi_[i]);
v = image_.getProcessor().getStats().mean;
data[i].add((double)imagesReceived_, v, false);
}
image_.getProcessor().setRoi(roi_[ROIs_ - 1]);
v = image_.getProcessor().getStats().mean;
data[ROIs_ - 1].add((double)imagesReceived_, v, true);
}
}
data[] are the JFreeChart data series corresponding to preset ROIs.
skip_ is use to control refresh rate, not to create 100 pps (points per
second) :)
But the problem is that imagej processor is returning the same value
always. I'm refreshing the reference at each NewImage event and still.
Even different ROIs return the same value for mean, which clearly should
not be.
Should I forget about ImageJ ? That does not sound right though.
Nico ? Mark ?
--
Carlos G Mendioroz <tr...@ac...>
|