Length measurement based on fluorescence intensity cutoff

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

Length measurement based on fluorescence intensity cutoff

wei.jian
This post was updated on .
Hi there,

I would like to enquire if there is any good quality check that I can
incorporate into my code for length measurement of a fluorescence image.

RefLineScan is a line scan of a linear structure with the indicated
intensity values. For length measurement, I would like to use 0.2 as the
cutoff. I.e. Pixel values >=0.2 will be considered as part of the length.
For the e.g. below, the length of the structure is 7 pixels.

Issue 1:
However, I realised that if the signal:noise of the image is poor, this
cutoff is not effective because hot pixels will be included as part of the
structure length. Hence, may I know if there's a good way whereby I only
consider a specific number of pixel as part of a structure length if
consecutive pixel values are above the set cutoff. I.e. Consecutive pixels
(for e.g. 3 pixels) need to have a value>=0.2 for them to be considered as
part of the structure.

Issue 2:
Apart from length measurement, I would also like to measure the relative
start position of the signal of interest. However, I'll encounter a problem
if the start value is observed more than once (for e.g. 0.21 is the start
value at position 2 but it also appears in position 8 of the array). May I
know if there's an easy way to ensure that I pick position 2?

//Start of code:
RefLineScan = newArray(0.11, 0.21, 0.31, 0.41, 0.51, 0.45, 0.35, 0.21,
0.15);
Array.show(RefLineScan);
                       
                        SingleCutOff = 0.2; //user defined cutoff
                        RefLineScanII = newArray(RefLineScan.length);
                        a = 0;
                        for (cut=0; cut<RefLineScan.length; cut++) {
                                if (RefLineScan[cut]>=SingleCutOff) {
                                        RefLineScanII[a] = RefLineScan[cut];
                                        a++;
                                }
                                startvalue = RefLineScanII[0];
                                if(startvalue == RefLineScan[cut]) {
                                CenStart = cut;
                                CenStartTab = Array.concat(CenStartTab, CenStart);
                        }
                }
Array.show(RefLineScanII);
Array.show(Array.trim(RefLineScanII, a));
CenWidth = a;
CenWidthTab = Array.concat(CenWidthTab, CenWidth);
Array.show(CenStartTab, CenWidthTab);
//End of code

Lastly, the reason why I used array.concat() is because this code is part of
a loop that measures length in multiple images. Array.concat() allows me to
have all the values in the same table.
Many thanks in advance.
WJ



--
Sent from: http://imagej.1557.x6.nabble.com/

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

Re: Length measurement based on fluorescence measurement

Philip Ershler-2
If your fluorescent signal is noisy, I would think you ought to select a chunk of the background and average the pixels. Then calculate f/f0 where F0 is the average background signal and f is each pixel in the image. That might help setting your threshold.

HTH,

Phil

> On May 24, 2018, at 8:57 PM, wei.jian <[hidden email]> wrote:
>
> Hi there,
>
> I would like to enquire if there is any good quality check that I can
> incorporate into my code for length measurement of a fluorescence image.
>
> RefLineScan is a line scan of a linear structure with the indicated
> intensity values. For length measurement, I would like to use 0.2 as the
> cutoff. I.e. Pixel values >=0.2 will be considered as part of the length.
> For the e.g. below, the length of the structure is 7 pixels.
>
> Issue 1:
> However, I realised that if the signal:noise of the image is poor, this
> cutoff is not effective because hot pixels will be included as part of the
> structure length. Hence, may I know if there's a good way whereby I only
> consider a specific number of pixel as part of a structure length if
> consecutive pixel values are above the set cutoff. I.e. Consecutive pixels
> (for e.g. 3 pixels) need to have a value>=0.2 for them to be considered as
> part of the structure.
>
> Issue 2:
> Apart from length measurement, I would also like to measure the relative
> start position of the signal of interest. However, I'll encounter a problem
> if the start value is observed more than once (for e.g. 0.21 is the start
> value at position 2 but it also appears in position 8 of the array). May I
> know if there's an easy way to ensure that I pick position 2?
>
> //Start of code:
> RefLineScan = newArray(0.11, 0.21, 0.31, 0.41, 0.51, 0.45, 0.35, 0.21,
> 0.15);        
> Array.show(RefLineScan);
>            
>            SingleCutOff = 0.2;                //user defined cutoff
>            RefLineScanII = newArray(RefLineScan.length);
>            a = 0;
>            for (cut=0; cut<RefLineScan.length; cut++) {
>                if (RefLineScan[cut]>=SingleCutOff) {
>                    RefLineScanII[a] = RefLineScan[cut];
>                    a++;        
>                }
>                startvalue = RefLineScanII[0];
>                if(startvalue == RefLineScan[cut]) {
>                CenStart = cut;    
>                CenStartTab = Array.concat(CenStartTab, CenStart);
>            }
>        }
> Array.show(RefLineScanII);
> Array.show(Array.trim(RefLineScanII, a));
> CenWidth = a;
> CenWidthTab = Array.concat(CenWidthTab, CenWidth);
> Array.show(CenStartTab, CenWidthTab);
> //End of code
>
> Lastly, the reason why I used array.concat() is because this code is part of
> a loop that measures length in multiple images. Array.concat() allows me to
> have all the values in the same table.
> Many thanks in advance.
> WJ
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Length measurement based on fluorescence measurement

wei.jian
Hi Phil,

Thanks for your suggestion. That's a good idea.

However, that method doesn't rule out hot pixels and those pixels would
still be considered as part of my length of interest. This is why I hope to
layer in some quality checks into my length measurement code to ensure those
pixels are excluded.

Thanks again.
WJ



--
Sent from: http://imagej.1557.x6.nabble.com/

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