Login  Register

Re: Rename output from "Straighten..." (as a function argument)

Posted by Krs5 on May 06, 2014; 9:22am
URL: http://imagej.273.s1.nabble.com/Rename-output-from-Straighten-as-a-function-argument-tp5007587p5007591.html

Hi Volker,

If this does not solve the problem it is possible that the Straighten image is not created yet when you try to rename it. As a result the raw image is renamed. If so, add:  wait(100); before rename. You can change the 100 to any number that works (1000 = 1 second).

Best wishes

Kees

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Volker Wirth
Sent: 06 May 2014 09:56
To: [hidden email]
Subject: Re: Rename output from "Straighten..." (as a function argument)

Hi Gabriel,
thank you for the quick reply, I will implement it like that.
Cheers,
Volker

2014-05-06 10:12 GMT+02:00 Gabriel Landini <[hidden email]>:

> On Tuesday 06 May 2014 10:00:34 you wrote:
>> Hi,
>> my macro is using the command Edit>Selection>Straighten in a loop to
>> extract lines from several ROIs on a stack. The code looks like this:
>>
>> ... in a loop
>> {
>>      selectWindow(rawStack);
>>      roiManager("Select", currROIindex);
>>      run("Straighten...", "line=20 process");
>>      rename(currOutputName);
>> }
>>
>> The problem with this is that sometimes the "rename"-command is
>> applied on the raw stack image instead of the straightened output
>> image. I cannot exclude that it is a problem with users' impatience
>> (and clicking on images at the wrong time), but it might help to make
>> it more stable, anyway.
>>
>> Is there an option for Straighten to do the renaming immediately? I
>> imagine something like:
>
> Not in the macro language.
>
> You could specify again the selected image that needs to be renamed.
> Assuming that the window has no extension, the straightened image name
> should be predictable: the original name +"-1".
>
> Something like:
>
>  {
>     selectWindow(rawStack);
>     roiManager("Select", currROIindex);
>     run("Straighten...", "line=20 process");
>     selectWindow(originalName+"-1");
>     rename(currOutputName);
> }
>
>
> Cheers
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

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