Login  Register

Re: selectWindow does not work

Posted by Herbie on Oct 28, 2019; 11:04am
URL: http://imagej.273.s1.nabble.com/selectWindow-does-not-work-tp5022577p5022590.html

Merci Philippe,

pour ta suggestion!

I don't like substring for this purpose because there are file suffixes
containing more than 3 chars...

A la prochaine

Herbie

:::::::::::::::::::::::::::::::::::::::::::::::::
Am 28.10.19 um 11:55 schrieb CARL Philippe (LBP):

> Gruss Gott Herbie and dear Kerstin,
> Your code below will be working, there is no issue about this.
> Nevertheless, I think it is somehow over killing to use a split function simply in order to reduce the size of a String.
> I say this given especially that you need then two lines in order to get your results.
> Thus why not simply use of the substring method within the following code?:
> imgTitle="191014_Hela_5min.czi"
> print("c:1/2 - " + substring(imgTitle, 0, lengthOf(imgTitle) - 4));
> My best regards,
> Philippe
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies
> UMR 7021 CNRS - Université de Strasbourg
> Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> ----- Mail original -----
> De: "Herbie" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Lundi 28 Octobre 2019 11:07:28
> Objet: Re: selectWindow does not work
>
> Thanks for the details Kerstin!
>
> Please run the following test-macro.
> (Copy the macro code lines to an empty macro window
> "Plugins >> New >> Macro" and run it.)
> ////
> imgTitle="191014_Hela_5min.czi"; // name of the open stack
> nme=split(imgTitle, ".");
> print("c:1/2 - "+nme[0]);
> ////
>
> For me the Log-window then shows the string:
>     c:1/2 - 191014_Hela_5min
> which should be the title of the desired image after calling
>     run("Stack to Images");
>
> Please confirm that the Log-window shows the correct name of the image.
>
> Regards
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::
> Am 28.10.19 um 10:52 schrieb kefe:
>> Hello,
>>
>> the name of the image is in general the date-cellline-time.czi for example:
>> 191014_Hela_5min.czi optionally.nd2
>>
>> well, the files are saved like this by the microscope and I dont think I
>> have any possibility to change it.
>>
>> Best,
>
> --
> 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