Recurrent Errors with Density Distribution Analysis

Skip to first unread message


Sep 13, 2015, 3:45:32 PM9/13/15
to BoneJ Users and Developers
Dear all, 

I am currently working on a project that deals with femoral bone density analysis (cortical bone). I am new to imageJ and boneJ but I have been following the guides posted online on how to get started. My images are all 16-bit DICOMS scanned from a GE microCT. 

From what I understand from the BoneJ guide, the Density Distribution Analysis should be able to help me get started with bone measurements. Unfortunately I have been running into recurrent issues with this function and many others. I am not sure if my image is in the correct format, if I need to calibrate a certain feature, or if there is something in my setting that are off. 
I repeatedly receive an array index out of bounds message and I am looking for insight on how to solve this problem. I have attached multiple screen shots for reference. I would appreciate any help or suggestions!

Thank you in advance,
Sharon Scarlat
Screen Shot 2015-09-11 at 4.22.57 PM.png
Screen Shot 2015-09-11 at 4.22.22 PM.png
Screen Shot 2015-09-11 at 4.22.00 PM.png

Timo Rantalainen

Sep 13, 2015, 7:27:32 PM9/13/15
Dear Sharon,
Thanks for attaching those screenshots, and describing the error in detail!

From the attached screenshots it looks like the plug-in thinks that the appropriate scaling is -2^15 with a slope of 1 (i.e. values in file minus -2^15). This is most likely incorrect, and you need to give the plug-in proper scaling from the 16-bit integers in the file to volumetric density values. Without checking the code, I'd guess the error is caused by the plug-in looking for an area above the threshold given (550 in your screenshot). Since there aren't any pixels above the threshold the search runs out of the image (I don't think I would've implemented a gracious exit for that case), and thus produces an error.

On a related note, what exactly are you after from your image? The plug-in is meant for examining the cross-section of a long bone diaphysis (thus relatively circular, and low rate of radius length change when going around the bone). Looking at a bone in a sagittal slice, you'll end up with very poor resolution for your metaphyses as the radius from the centre of the bone to the circumference changes rapidly with angle (the analysis is done using a polar coordinate system with the origin at the area centre of the medullary cavity). You might be better off with some other sort of analysis approach (obviously depending on your research question. For density distribution you might e.g. look at the distribution in Cartesian coordinate system, and normalize with bone length [for distribution along the bone length] and width [for distribution across the bone length]).


Important Notice: The contents of this email are intended solely for the named addressee and are confidential; any unauthorised use, reproduction or storage of the contents is expressly prohibited. If you have received this email in error, please delete it and any attachments immediately and advise the sender by return email or telephone.

Deakin University does not warrant that this email and any attachments are error or virus free.

Michael Doube

Sep 14, 2015, 5:01:10 AM9/14/15
to BoneJ Users and Developers
Dear Sharon,

Timo raises an important issue, which is whether or not your images are calibrated to measure density.

At the very least, you need to image a series of phantoms to generate a standard curve that gives you a function that converts pixel values into attenuation coefficients or concentration of hydroxyapatite, or BMD.

ImageJ's image format can store that calibration function and do all the pixel value -> density conversion for you. See Analyze > Calibrate...

A further issue is what kind of imaging artefacts you have. Your images are a bit noisy and I can see some streak artefacts. If you look closer you might find some artefacts that relate to the reconstruction algorithm or image filtering, or partial volume effects if your pixel spacing is large relative to bony feature size. There's likely some beam hardening in there too. So, you have to be very careful about overinterpreting pixel values, especially if you want to leap all the way from pixel value to BMD. I would urge caution. pQCT devices are specially designed and calibrated to measure mineral density, whereas most XMT scanners are not by default well set up to do this (you have to work quite hard to get a quantitative density measure from XMT, and it often involves very slow scans).

Best regards,



Sep 15, 2015, 2:22:32 PM9/15/15
to BoneJ Users and Developers
Dear Timo,

Thank you for your quick response! 
What you've mentioned about the image makes sense to me. I wasn't sure about what type of image the analysis would work on. Is there a function in boneJ that can transform my DICOM image into a cross-section of a tibial mid-shaft image? Once I get my cross-sectional image, how exactly do I go about scaling the image correctly so that the plug-in can process it? 

Dear Michael,

Thank you for your input. I have scanned a phantom with different known densities of HA and I will try to calibrate them using the imageJ instruction link. Could this be the overarching problem in my analysis? As far as beam hardening, I will speak with the person who is helping me use the actual microCT to minimize the noise. Perhaps it would be better to seek a pQCT device instead of our XMT. 

My goal with the analysis of these images are to obtain measurements that include those associated with cortical bone and trabeculations to measure relative density of mice. Essentially what I would like to do is mimic the experimental paradigm in this paper: I've attached their figures section in case the paper doesn't open up.

Lastly, thank you so much for taking the time to respond with your thoughtful suggestions and recommendations. I greatly appreciate it! 


Timo Rantalainen

Sep 15, 2015, 8:58:12 PM9/15/15
Dear Sharon,

> What you've mentioned about the image makes sense to me. I wasn't sure
> about what type of image the analysis would work on. Is there a function in
> boneJ that can transform my DICOM image into a cross-section of a tibial
> mid-shaft image? Once I get my cross-sectional image, how exactly do I go

I'm not sure I understand the question. To me 'transform' in this context would mean going (=transforming) from one coordinate system to another, and there is no transform that can lead into a cross-section from a sagittal slice (although this has been attempted from DXA. The approach requires several assumptions that are almost guaranteed not to be accurate).

Now to what I think you might mean;
I suspect you've got a 3D stack of the bone. Simply look at the stack from a direction that gives you coronal slices to get 'circular' cross-sections. You could then extract that one slice as a new image, and run density distribution analysis on that slice (haven't tried this approach but I'm pretty sure there's a 3D toolbox for working with image stacks for ImageJ, or this might be included in BoneJ already. If not, I've already written plug-ins to do just that for my own needs, so I could just release that code to public domain or add to BoneJ or some other suitable solution). A marco would be well-suited for this sort of a task.

Sep 16, 2015, 4:28:32 AM9/16/15

Use the 'reslice' functionality of ImageJ.

Better still, image the bones so their long axis is centred on the rotational axis of the scan. It looks like your bones have been placed in the scanner lying down, which means you are getting much (10x) poorer resolution than possible.

> --
> You received this message because you are subscribed to the Google Groups "BoneJ Users and Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> To post to this group, send email to
> Visit this group at
> For more options, visit

Sent from my Jolla

Daniel J Schiferl

Sep 16, 2015, 5:58:46 AM9/16/15

I have used pQCT animal systems if you're looking.  I've also attached my latest bone J manual for pQCT images. 

Daniel J. Schiferl
Bone Diagnostic Inc.
1114 Elsie St.
Fort Atkinson, WI 53538
Phone 414-217-8456
BoneJ pQCT User Manual_V2.doc
Reply all
Reply to author
0 new messages