rename a file in *.stk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

rename a file in *.stk

Thomas GUILBERT
Hi everybody,

first post here.
Does anyone know how can I change file's extension '*.tif' to '*.stk' in macro command 'saveAs', or something elses ?

thank you,

Thom G.
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Rainer M. Engel
> first post here.
> Does anyone know how can I change file's extension '*.tif' to '*.stk' in macro command 'saveAs', or something elses ?

Hi Thomas,

try something like this..


opath = outPath+File.separator+list1[i]; //outPath is your target folder
dotIndex = lastIndexOf(opath, ".");
if (dotIndex!=-1)
opath = substring(opath, 0, dotIndex); // remove extension
save(opath+".stk");



Regards,
Rainer


--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorferstr. 143
D-13595 Berlin
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Thomas GUILBERT
In reply to this post by Thomas GUILBERT
Thank you Rainer for your fast reply !

Well, I should have post part of my code.

"temp = File.nameWithoutExtension;" gives, as its name suggest, file name without extension.

My problem occurs when I try to save in .stk :

"Unsupported save() or saveAs() file format stk"

Thanks !
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Rainer M. Engel
Am 02.02.2012 12:18, schrieb Thomas GUILBERT:

> Thank you Rainer for your fast reply !
>
> Well, I should have post part of my code.
>
> "temp = File.nameWithoutExtension;" gives, as its name suggest, file name without extension.
>
> My problem occurs when I try to save in .stk :
>
> "Unsupported save() or saveAs() file format stk"
>
> Thanks !
>


OK. In my world (field of work) are not so many formats to care about.
More colorspaces and profiles..

If ImageJ doesn't support a format you may have a look at a tutorial of
Albert Cardona "How to integrate a new file format reader and writer".
http://albert.rierol.net/imagej_programming_tutorials.html

or you may try a tool like this..
http://www.bioimage.ucsb.edu/BioImage%20Convert

Reminds me of some questions I wanted to ask myself..

Good Luck.


--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorferstr. 143
D-13595 Berlin
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

ctrueden
In reply to this post by Thomas GUILBERT
Hi Thomas,

Does anyone know how can I change file's extension '*.tif' to '*.stk' in
> macro command 'saveAs', or something elses ?
>

ImageJ does not have built-in support for Metamorph STK, nor can any plugin
that I know of save to that format. The Bio-Formats plugin (
http://loci.wisc.edu/bio-formats/imagej) can read many formats including
Metamorph STK, but we intentionally do not provide export to proprietary
file formats such as STK. The reason is twofold: 1) it would be a
prohibitively large amount of work to create file format exporters for all
these formats; and 2) philosophically, we do not want to encourage the
proliferation of these formats. Better to convert your file to an open
format such as OME-TIFF (
http://www.openmicroscopy.org/site/support/file-formats/ome-tiff).

If you *must* convert to STK specifically, easiest would be to use
Metamorph to do it, rather than ImageJ. You can always save to TIFF in
ImageJ, then open the TIFF in Metamorph and save as STK.

Regards,
Curtis


On Thu, Feb 2, 2012 at 4:33 AM, Thomas GUILBERT
<[hidden email]>wrote:

> Hi everybody,
>
> first post here.
> Does anyone know how can I change file's extension '*.tif' to '*.stk' in
> macro command 'saveAs', or something elses ?
>
> thank you,
>
> Thom G.
>
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Thomas GUILBERT
In reply to this post by Thomas GUILBERT
Thank you all for your kind answers.

I finally wrote a little program in matlab to change my files extensions.

Have a nice week end !

Thom G.
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Unruh, Jay-2
If you just want to change extensions in a folder in windows, just go to the command line and run "rename *.tif *.stk".

Jay

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Thomas GUILBERT
Sent: Friday, February 03, 2012 9:43 AM
To: [hidden email]
Subject: Re: rename a file in *.stk

Thank you all for your kind answers.

I finally wrote a little program in matlab to change my files extensions.

Have a nice week end !

Thom G.
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

Thomas GUILBERT
In reply to this post by Thomas GUILBERT
Thanks Jay : my problem was to change the extension of over 500 files ...
Less than 2 minutes thanks to Matlab !
Reply | Threaded
Open this post in threaded view
|

Re: rename a file in *.stk

dscho
Hi Thomas,

On Fri, 3 Feb 2012, Thomas GUILBERT wrote:

> Thanks Jay : my problem was to change the extension of over 500 files ...
> Less than 2 minutes thanks to Matlab !

You realize that typing "rename *.stk *.tif" takes less than that, right?

Hth,
Johannes