Login  Register

Re: Plot profile doesn't list pixel-values

Posted by chai_san on Apr 10, 2011; 10:20am
URL: http://imagej.273.s1.nabble.com/Plot-profile-doesn-t-list-pixel-values-tp3684682p3684683.html

This is my workaround:


// StackIntensityProfile
// Chaitanya Athale 2011-04-08
// Stores profile intensities along some coordinate in stack


macro "Stack intensity profile" {
    requires("1.33r");
    saveSettings();
    run("Clear Results");

   
    if (nSlices==1)
      exit("Stack required");
   
   

    setBatchMode(true);
    stack1 = getImageID;

    n = nSlices;
    //print("No. of slices", n);

    showMessageWithCancel("Select a line for profile");
    profile = getProfile();
    //print(""profile_size: ", profile.length);
    p = profile.length;
   


    for (s=1; s<n; s++) {
        //print line profile values
        for(i=0;i<p;i++){
              print("slice, ",s, ", L, ", i, ", I(t), ",profile[i]);
        }
        showProgress(s, n);
        //print("i=",s);
               
        //showMessageWithCancel("Do we proceed?");

        setSlice(s);
        run("Next Slice [>]");
       
    }
    setBatchMode(false);
    restoreSettings();
    setSlice(1);
}


Ideally I'd like to output it into the Result window, but needed this in a hurry.
Chaitanya.