Dear Julie,
I’ve started aligning scans based on both bones (not based on imax/imin but the line between bone area centres) and would recommend that approach. This would be the (not_)Selected_to_right option.
You shouldn’t have to separate left and right limb scans manually (for bone sites with two bones visible that is), with appropriate cues (boxes ticked), I’ve always had perfect classification of body side. For example, I’ve ticked guess flip, guess right and stacked bones for distal radius in my latest batch of analysis. I’ve pasted below the ImageJ macros for 4% and 66% radius analysis I used in my most recent batch run, hopefully those will be helpful in sorting this out. The lines starting with ‘parameterString =’ are the ones that contain pertinent information (i.e. the boxes that you’d need to tick).
On a somewhat related note, I am in the middle of moving continents (from Oz to Finland to be precise) so I will not be necessarily likely to be able respond to any follow-ups in a timely manner.
Sincerely,
-Timo
ImageJ macros:
macro "DistalRadius"{
resultsDir = "c:/path/here/";
setBatchMode(true);
//rad4
boneSite = "rad4";
saveBoneSite = "rad4";
parameterString = " air_threshold=-40.0 fat=40.0 muscle_threshold=40.0 marrow_threshold=80 soft_tissue_threshold=200 rotation_threshold=169.000 area=169.0000 bmd=169.0000 roi_selection=Bigger soft_tissue_roi_selection=Bigger rotation_selection=Not_selected_to_right analyse_cortical_results analyse_mass_distribution analyse_concentric_density_distribution allow_cleaving suppress_result_image guess_flip guess_right stacked_bones";
analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString);
//ulna4
boneSite = "rad4";
saveBoneSite = "ulna4";
parameterString = " air_threshold=-40.0 fat=40.0 muscle_threshold=40.0 marrow_threshold=80 soft_tissue_threshold=200 rotation_threshold=169.000 area=169.0000 bmd=169.0000 roi_selection=SecondLargest soft_tissue_roi_selection=Bigger rotation_selection=Selected_to_right analyse_cortical_results analyse_mass_distribution analyse_concentric_density_distribution allow_cleaving suppress_result_image guess_flip guess_larger stacked_bones";
analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString);
setBatchMode(false);
}
//FUNCTION TO ANALYSE FILES
function analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString){
sourceDir = resultsDir+"data/"+boneSite+"/";
visualDir = resultsDir+"visual/"+saveBoneSite+"/";
saveName = "results/"+saveBoneSite+".xls";
parameters = parameterString+" "+"save_visual_result_image_on_disk image_save_path="+visualDir;
files = getFileList(sourceDir);
//IJ.log("Analyysiin "+files.length+" tiedostoa");
//IJ.log(sourceDir);
//IJ.log(visualDir);
//IJ.log(saveName);
for (i =0; i<files.length;++i){//i<1;++i){//
showProgress(i+1, files.length);
if(startsWith(files[i],"I00")){
run("Stratec pQCT", "select="+sourceDir+files[i]);
run("Distribution Analysis", parameters);
close();
}
while(isOpen("Exception")){
selectWindow("Exception");
run("Close");
}
}
selectWindow("Results");
saveAs("Results", resultsDir+saveName);
while (isOpen("Results")){
selectWindow("Results");
run("Close");
}
while(isOpen("Exception")){
selectWindow("Exception");
run("Close");
}
}
macro "RadialShaft"{
resultsDir = "c:/path/here/";
setBatchMode(true);
///rad60
boneSite = "rad66";
saveBoneSite = "rad66";
parameterString = " air_threshold=-40.0 fat=40.0 muscle_threshold=40.0 marrow_threshold=80 soft_tissue_threshold=200 rotation_threshold=280.000 area=480.0000 bmd=710.0000 roi_selection=Central rotation_selection=Not_selected_to_right analyse_cortical_results analyse_mass_distribution analyse_density_distribution analyse_soft_tissues suppress_result_image guess_right stacked_bones";
analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString);
//Ulna60
boneSite = "rad66";
saveBoneSite = "ulna66";
parameterString = " air_threshold=-40.0 fat=40.0 muscle_threshold=40.0 marrow_threshold=80 soft_tissue_threshold=200 rotation_threshold=280.000 area=480.0000 bmd=710.0000 roi_selection=Peripheral rotation_selection=Selected_to_right analyse_cortical_results analyse_mass_distribution analyse_density_distribution suppress_result_image guess_right stacked_bones invert_flip_guess";
analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString);
setBatchMode(false);
}
//FUNCTION TO ANALYSE FILES
function analyseFiles(boneSite,saveBoneSite,resultsDir,parameterString){
sourceDir = resultsDir+"data/"+boneSite+"/";
visualDir = resultsDir+"visual/"+saveBoneSite+"/";
saveName = "results/"+saveBoneSite+".xls";
parameters = parameterString+" "+"save_visual_result_image_on_disk image_save_path="+visualDir;
files = getFileList(sourceDir);
//IJ.log("Analyysiin "+files.length+" tiedostoa");
//IJ.log(sourceDir);
//IJ.log(visualDir);
//IJ.log(saveName);
for (i =0; i<files.length;++i){//i<1;++i){//
showProgress(i+1, files.length);
if(startsWith(files[i],"I00")){
run("Stratec pQCT", "select="+sourceDir+files[i]);
run("Distribution Analysis", parameters);
close();
}
while(isOpen("Exception")){
selectWindow("Exception");
run("Close");
}
}
selectWindow("Results");
saveAs("Results", resultsDir+saveName);
while (isOpen("Results")){
selectWindow("Results");
run("Close");
}
while(isOpen("Exception")){
selectWindow("Exception");
run("Close");
}
}