Login  Register

Re: Calculate the concentration in a CT image

Posted by Mauro Maiorca on Nov 08, 2019; 6:30pm
URL: http://imagej.273.s1.nabble.com/Calculate-the-concentration-in-a-CT-image-tp5022621p5022630.html

Dear Yongqian,

Thank you so much.
> Yes, I think it is a right direction.
>

that's good! ;-)


> Do you have any idea to handle the non-linear relationship? I just got
> their scanning information. They did calibration scanning with different
> concentration of KI in water. So the data need to be fitted to get the
> relation between CT number and (most probably it's not a linear relation).
>
> In the Process->Math, to use other operator, like log, exp or square, to
> do it?
>

yep, once you figure out the right formula to use, then you can translate
it to a cascade of operators (like log, exp or square, as you suggested),
and even write a macro if you want to automatise the procedure.
Furthermore, if in your formula you need more instances of the initial
image, you can go "image->duplicate" from the original image, and use
"process->Image Calculator" accordingly.

said that, although effective, this may not be the most elegant way to
proceed. As others suggested, you can use getPixel/setPixel macros, or you
can implement your own plugin, or you may consider rescaling your images
using external programs (for example using matlab/octave/python/etc ), and
so on.

cheers,
Mauro


-----Original Message-----

> From: Mauro Maiorca <[hidden email]>
> Sent: 08 November 2019 12:40
> To: [hidden email]
> Subject: Re: Calculate the concentration in a CT image
>
> Dear Yongqiang,
>
> I understand you are aiming to linearly rescale intensity values in the
> image using ImageJ.
>
> I will give you an example of how I would do it, and you can adapt it to
> your specific problem.
>
> Assuming you want to convert your recorded "CT number" values to
> Hounsfield Unit, and (as an example) you are using the conversion formula
> described on wikipedia (https://en.wikipedia.org/wiki/Hounsfield_scale):
> HU=1000*(mu-mu_water)/(mu_water-mu_air)
> Assuming your recorded mu_water is 15, and your recorded mu_air is -1100:
> HU=1000*(mu-15)/(15+1100)= (1000/1115)*(mu-15) = 0.897*(mu-15) Open your
> image with ImageJ, go to Process>Math>Subtract, put value 15 and click OK
> go to Process>Math>Multiply, put value 0.897 and click OK The intensity
> values in the image are now linearly rescaled.
>
> Is this what you were looking for?
>
> cheers,
> Mauro
>
>
> On Fri, Nov 8, 2019 at 7:45 AM Yongqiang Chen <
> [hidden email]> wrote:
>
> > Hi Kenneth and Stein,
> >
> > Thank you for your kind replies.
> >
> > To summarize the problem in one sentence, it is to replace the CT
> > number with concentration value or whatever else we want.
> > I believe interpolation can work. Could you please give me some hints
> > for interpolation implement in ImageJ (or to replace CT number with
> > concentration.)?
> >
> > Thank you so much.
> > Yongqiang
> >
> > -----Original Message-----
> > From: Stein Rørvik <[hidden email]>
> > Sent: 08 November 2019 01:54
> > To: [hidden email]
> > Subject: Re: Calculate the concentration in a CT image
> >
> > Yes this is doable as per Kenneth's explanation, but you really need
> > to understand the physics involved in your imaging.
> >
> > If you are using monochromatic X-rays (from a synchrotron) and your
> > software's "CT number" is proportional to your material's linear
> > attenuation coefficient, then the simple linear interpolation "method a"
> > will work. As this is quite unlikely (you probably have a
> > polychromatic source if you are using an in-house CT system), it
> > greatly depends on whether or not your elements distribution is
> > radially symmetric in all directions. The reason for this is that the
> > X-rays loose energy as they pass through the sample, so the apparent
> > concentration in the central parts will be lower than in the outer
> > parts. This phenomenon is called "beam hardening". You can compensate
> > this with X-Ray filtering, or software corrections (if the
> > distribution is symmetric). My experience is that software corrections
> > work better, as filtering really kills the signal noise ratio. Anyway
> > your CT software must still be calculating the attenuation
> > coefficients correctly, and that greatly depends on how clever your
> software is.
> >
> > This is in any case easy to check: Just scan a round plastic container
> > with pure KI brine, and then check the radial profile. Is it flat?  If
> > yes, then "method b" should work; it probably needs an exponential
> > profile. If it is not flat, you must revise your imaging setup and/or
> > your CT software processing settings. If the KI profile is flat,
> > repeat the experiment with pure water. If that is flat too, even
> > "method a" should work. If KI is your heaviest compound in your system
> > and the overall concentration is low, and all your other elements are
> light (low atomic numbers), then "method a"
> > might also work even if the test profiles for KI is not flat. But
> > again that will depend on your elements' distribution in the sample
> > and the symmetry of everything. So again you need to understand the
> > X-Ray imaging physics and how it applies to your sample.
> >
> > It will help if you post some example images, including all instrument
> > related metadata. Also please tell what instrument and what software
> > you are using for the generation of the CT images. I have considerable
> > experience with such measurements from µCT images so I should be able
> > to see if your images are analyzable or not.
> >
> > Stein
> >
> > -----Original Message-----
> > From: ImageJ Interest Group <[hidden email]> On Behalf Of Kenneth
> > Sloan
> > Sent: 7. november 2019 21:35
> > To: [hidden email]
> > Subject: Re: Calculate the concentration in a CT image
> >
> > Knowing nothing about this particular application, I will assume nothing.
> >
> > So far, you seem to have two pairs of (CT Number, concentration):
> >
> >         (loCT, loConcentration)
> >         (hiCT, hiConcentration)
> >
> > You want to convert intermediate (or more extreme?) CT numbers into
> > concentrations.
> >
> > Method a) assume everything is linear, and just use linear interpolation:
> >
> >           u = (CT-loCT) / (hiCT-loCT)
> >           CT = loConcentration + (u  *
> > (hiConcentration-loConcentration))
> >
> > I DO NOT RECOMMEND this method!
> >
> >
> > Method b) gather more data - measure CT numbers for known
> > concentrations, fit a function to your measurements,
> >             and evaluate this function at new measured CT numbers.
> >
> > I might start by measuring the CT number for (loConcentration +
> > hiConcentration)/2.  If (by some miracle) this turns out to be = (loCT
> > +
> > hiCT) / 2, then go to Method a)  Otherwise, measure at ¼ and ¾.
> > Continue sub-dividing until you are happy with a low-degree polynomial
> > that fits your data.
> >
> > The usual caveats about fitting a predictor to data apply -  in
> > particular, it is dangerous to EXTRAPOLATE from the measured values.
> > Interpolation is much safer.  And, avoid high-degree polynomials which
> > may overfit your data.
> >
> > Also consider exponential/log functions.  If you know anything about
> > the physics of the imaging, use that.
> >
> > --
> > Kenneth Sloan
> > [hidden email]
> > Vision is the art of seeing what is invisible to others.
> >
> >
> >
> >
> > >
> > >
> > > I am processing a CT image. They have two different brines mixed
> > together. One fluid is high CT number. Its concentration is 2mol/L (KI
> > doped). Another brine is pure water and its CT number is low.
> > >
> > > I want to relate the CT number to the concentration value. (Let's
> > > assume that the brightest part is 2 mol/L fluid and pure water is
> > > lowest CT number)
> > >
> > > Can anybody help me with the above question?
> > >
> >
> > --
> > ImageJ mailing list:
> > https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimage
> > j.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7Cstein.rorvik%40sintef.no
> > %7Cf22112f0eb0844a6569708d763c37804%7Ce1f00f39604145b0b309e0210d8b32af
> > %7C1%7C0%7C637087563501115145&amp;sdata=XFl%2FV1LOQkf2E3QxibNVnO32vSvv
> > k38lss%2Bs07lT3w8%3D&amp;reserved=0
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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