RE: JACop batch processing

Posted by Interleukin-10 on
URL: http://imagej.273.s1.nabble.com/JACop-batch-processing-tp5009015p5009144.html

Hello,

This is the macro that I have been working on: Basically, it is supposed to open my directory that contains all the images I want to apply batch processing to. From these images I want to select cells (by creating a rectangle), crop the cell, split channels, convert to 8-bit format and then apply JaCop. The problem once again, is that y macro is specific for one image that I used to record the macro (ex. you will notice C2-practivComposite in the code).

Thanks again for your help,
Kamaldeep

dir=getDirectory("image");

 

close();

 

list=getFileList(dir);

 

for (i=0;i<list.length;i++){

 

  path = dir+list[i];

 

  if (!endsWith(path,"/")) open(path);

 

  runMacro("Macro2.ijm");

 

}

makeRectangle(173, 282, 48, 46);

run("Crop");

run("Split Channels");

title = getTitle();

     "red=[Edges of " + title + "] green=[" + title + "] blue=[" + title + "] gray=*None*");

selectWindow("C2-practivComposite.tif");

selectWindow("C1-practivComposite.tif");

run("8-bit");

selectWindow("C2-practivComposite.tif");

run("8-bit");

run("JACoP ");

selectWindow("C2-practivComposite.tif");

selectWindow("C1-practivComposite.tif");

selectWindow("C2-practivComposite.tif");

run("JACoP ", "imga=C1-practivComposite.tif imgb=C2-practivComposite.tif thra=43 thrb=24 pearson mm costesthr ccf=20 cytofluo ica costesrand=1-16-100-0.0010-0-false-true-true");

selectWindow("Costes' threshold C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("Costes' mask");

selectWindow("Van Steensel's CCF between C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("Cytofluorogram between C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("ICA A (C1-practivComposite.tif)");

selectWindow("ICA B (C2-practivComposite.tif)");

selectWindow("Randomized images of C2-practivComposite.tif");

selectWindow("Costes' method (C1-practivComposite.tif & C2-practivComposite.tif)");

selectWindow("Costes' threshold C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("Costes' mask");

selectWindow("C1-practivComposite.tif");

selectWindow("C2-practivComposite.tif");

selectWindow("Van Steensel's CCF between C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("Cytofluorogram between C1-practivComposite.tif and C2-practivComposite.tif");

selectWindow("ICA A (C1-practivComposite.tif)");

selectWindow("ICA B (C2-practivComposite.tif)");

selectWindow("Randomized images of C2-practivComposite.tif");

selectWindow("C1-practivComposite.tif");

selectWindow("C2-practivComposite.tif");

selectWindow("Costes' method (C1-practivComposite.tif & C2-practivComposite.tif)");

run("Close All");




From: Jasvinder S Ahuja [via ImageJ] [ml-node+[hidden email]]
Sent: Monday, August 11, 2014 8:06 PM
To: Jawanda, Kamaldeep Kaur
Subject: Re: JACop batch processing

Hi Kamaldeep,
I have recently learnt how a bit of code can make life so much easier! To
begin I suggest you visit -
http://adm.mri.cnrs.fr/datas/fichiers/articles/60/184.pdf
http://www.sussex.ac.uk/gdsc/intranet/pdfs/ImageJBatchProcessing.pdf

These are nice resources to get you started with batches of images.
Jasvinder


On Mon, Aug 11, 2014 at 11:38 AM, Interleukin-10 <
[hidden email]> wrote:

> Hi Pariksheet,
>
> Thank you for your response. I have figured out how to record the macros,
> but the problem I am having now is that my macro is specific for one image.
> How can I apply the macro to all my images? I get an error message saying
> my image name is different than the one in the macro (since it is specific
> for the image that I used to record the macro).
>
> I hope this makes sense.
>
> Anyways, any help would be greatly appreciated.
>
> Thanks again,
> Kamaldeep
> ________________________________
> From: Pariksheet Nanda [via ImageJ] [[hidden email]
> ]
> Sent: Sunday, August 10, 2014 3:50 PM
> To: Jawanda, Kamaldeep Kaur
> Subject: Re: JACop batch processing
>
> Hi Kamal,
>
> On Fri, Aug 1, 2014 at 7:00 PM, Interleukin-10
> <[hidden email]<UrlBlockedError.aspx>> wrote:
>
> >
> > I have a collection of several dozen images and I would like to do a
> > colocalisation analysis using JaCoP. Normally I do this manually
> > image-by-image but I believe there must be a way to record the macro for
> it;
> > I need to open each image, split it into the red and green channel, open
> > JACoP and choose the object-based analysis for the two channels, setting
> the
> > pixel size and threshold (which remain the same for all the images) and
> > running the analysis.
> >
> > What do you suggest? I would be very grateful for any comments.
>
> Open your image, then launch the macro recorder using:
>
>    Plugins > Macros > Record...
>
> Then as you perform your usual image processing steps, the
> corresponding ImageJ macro commands will be recorded.  When you are
> done, in the Recorder window, hit the "Create" button to save the
> macro.  You can run it the next time with:
>
>    Plugins > Macros > Run...
>
> Further reading:
> http://imagej.nih.gov/ij/docs/guide/146-31.html#toc-Subsection-31.1
> http://imagej.nih.gov/ij/developer/macro/macros.html
>
>
> Pariksheet
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://imagej.1557.x6.nabble.com/JACop-batch-processing-tp5009015p5009084.html
> To unsubscribe from JACop batch processing, click here<
> >.
> NAML<
>
http://imagej.1557.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/JACop-batch-processing-tp5009015p5009095.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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



If you reply to this email, your message will be added to the discussion below:
http://imagej.1557.x6.nabble.com/JACop-batch-processing-tp5009015p5009117.html
To unsubscribe from JACop batch processing, click here.
NAML