distinct curve positions (ascending/descending)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

distinct curve positions (ascending/descending)

Rainer M. Engel
Hello everybody..

I'm working on a selection based on a plot profile (pixel values of a
line), where I want to detect luminance jumps and differentiate between
ascending and descending.

Here is an example..
https://dl.dropboxusercontent.com/u/414433/imagej/plots.png

Green: ascending marked
Red: descending marked

Is there anything I can start from directly available in imagej/fiji to
get these positions?

Thanks in advance..
Rainer

--
###################################
Rainer M. Engel
Pichelsdorfer Str. 143
13595 Berlin
###################################

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: distinct curve positions (ascending/descending)

Herbie
Rainer,

that's where basic mathematics is handy...

Does anything speak against differentiation?

I fear there is no "ready-made" for this purpose because it's so basic.
Just write a little macro.

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::::
Am 25.07.15 um 14:23 schrieb Rainer M. Engel:

> Hello everybody..
>
> I'm working on a selection based on a plot profile (pixel values of a
> line), where I want to detect luminance jumps and differentiate between
> ascending and descending.
>
> Here is an example..
> https://dl.dropboxusercontent.com/u/414433/imagej/plots.png
>
> Green: ascending marked
> Red: descending marked
>
> Is there anything I can start from directly available in imagej/fiji to
> get these positions?
>
> Thanks in advance..
> Rainer
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: distinct curve positions (ascending/descending)

Adrian Daerr-2
In reply to this post by Rainer M. Engel
Hello Rainer,

If pixel-precision is enough, this is what you can do:

- Image->Stacks->Reslice to get an image of your line profile
- Convolve with a kernel differentiating along your line (something like
-1 0 1 or its transpose, depending on how the result of Reslice is oriented)
- Threshold to isolate loci exceeding desired jump amplitude (positive
or negative)
- Save x,y coordinates of the thresholded pixels

If you use this to process a whole stack at once, be sure to rotate/flip
your thresholded picture so that points are saved grouped by frame
number (which after reslice becomes one of the screen coordinates).

If you need sub-pixel precision you can either scale the picture and use
a bigger differentiating kernel, or you have to write your own
correlation code (I can look for and send you some code I wrote a while
back if that helps).

cheers,
Adrian


On 2015-07-25 14:23, Rainer M. Engel wrote:

> Hello everybody..
>
> I'm working on a selection based on a plot profile (pixel values of a
> line), where I want to detect luminance jumps and differentiate between
> ascending and descending.
>
> Here is an example..
> https://dl.dropboxusercontent.com/u/414433/imagej/plots.png
>
> Green: ascending marked
> Red: descending marked
>
> Is there anything I can start from directly available in imagej/fiji to
> get these positions?
>
> Thanks in advance..
> Rainer
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: distinct curve positions (ascending/descending)

Rainer M. Engel
Dear Adrian and Herbie,

I tested several things the last days but I always ran into problems
with SNR. So the macro below works quite well for me now (having the
values in an Array "colsValsA").

> startP = 0;
> startVal = 0;
> endP = 0;
> endVal = 0;
> curveAsc = false;
> for (i=1; i<colsValsA.length; i++) {
> if (colsValsA[i] > colsValsA[(i-1)]) {
> if (curveAsc == false) {
> curveAsc = true;
> startP = i;
> startVal = colsValsA[i];
> }
> } else if (colsValsA[i] <= colsValsA[(i-1)]) {
> if (curveAsc == true) {
> curveAsc = false;
> endP = i;
> endVal = colsValsA[i];
> climax = ((endVal)-(startVal))/(endP-startP);
>
> if (climax >= 5) {
> print("startP: "+startP+", endP: "+endP+", climax: "+climax);
> }
> }
> }
> }


The reslicing plugin does a great job for pre-processing. I thing this
should work now in most cases. Thank you both for your help.

Best regards,
Rainer




Am 26.07.2015 um 13:40 schrieb Adrian Daerr:

> Hello Rainer,
>
> If pixel-precision is enough, this is what you can do:
>
> - Image->Stacks->Reslice to get an image of your line profile
> - Convolve with a kernel differentiating along your line (something like
> -1 0 1 or its transpose, depending on how the result of Reslice is
> oriented)
> - Threshold to isolate loci exceeding desired jump amplitude (positive
> or negative)
> - Save x,y coordinates of the thresholded pixels
>
> If you use this to process a whole stack at once, be sure to rotate/flip
> your thresholded picture so that points are saved grouped by frame
> number (which after reslice becomes one of the screen coordinates).
>
> If you need sub-pixel precision you can either scale the picture and use
> a bigger differentiating kernel, or you have to write your own
> correlation code (I can look for and send you some code I wrote a while
> back if that helps).
>
> cheers,
> Adrian
>
>
> On 2015-07-25 14:23, Rainer M. Engel wrote:
>> Hello everybody..
>>
>> I'm working on a selection based on a plot profile (pixel values of a
>> line), where I want to detect luminance jumps and differentiate between
>> ascending and descending.
>>
>> Here is an example..
>> https://dl.dropboxusercontent.com/u/414433/imagej/plots.png
>>
>> Green: ascending marked
>> Red: descending marked
>>
>> Is there anything I can start from directly available in imagej/fiji to
>> get these positions?
>>
>> Thanks in advance..
>> Rainer
>>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html