bUnwarpJ - loading mask from macro
Posted by jamier on Jun 13, 2011; 1:11pm
URL: http://imagej.273.s1.nabble.com/bUnwarpJ-loading-mask-from-macro-tp3684161.html
Hello All,
I am a novice using imageJ. At the moment I am working on a project whereby I wish to register bone scans to a target bone scan. I must load a mask prior to registration. This works successfully using the I/O menu of bUnwarpJ. Using the macro->record function of imageJ it appears the following command should load my saved mask file prior to registering:
run("bUnwarpJ", "load=/home/jamier/Fiji/BoneScans/Normals/Masks/N3_Ant_Mask.jpg source_image=[Source Anterior] target_image=[Target Anterior] registration=Accurate image_subsample_factor=0 initial_deformation=[Very Coarse] final_deformation=Fine divergence_weight=0 curl_weight=0 landmark_weight=0 image_weight=1 consistency_weight=10 stop_threshold=0.01");
I have written a short macro which opens the desired source image plus a dialogue for adjusting the various bUnwarpJ weights. However, this load source mask call does not work in my macro and the registration occurs without any mask and the corresponding registration is very poor. The section of my macro where bUnwarpJ is called is highlighted below. Is there a straightforward way to load a saved mask in bUnwarpJ using macros?
if (maskbool==1)
{
//run bUnwarpJ with source mask
run("bUnwarpJ",
" load =" + maskPath +
" source_image=" + si + " target_image=" + ti + " registration=" + r + " image_subsample_factor="+ img_sub_factor + " initial_deformation=" + id + " final_deformation=" + fd + " divergence_weight=" + dw + " curl_weight=" + curlw + " landmark_weight="+ lw + " image_weight=" + iw + " consistency_weight=" + conw + " stop_threshold=" + st + " " + verbose + str);
}