Saving XY files

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

Saving XY files

Flopi
Hi,
There is most probably a very obvious answer to my question, but I can't definitely find it. Moreover, it worked at some point, and I don't remember changing anything about the part of the code. My goal is, after doing some work on images, to record the XY coordinates of the final image. The problem is, everything goes normally, the log is ok, but at the end, no file is saved. I have been on it for some hours now and I have no idea what is going wrong.

Below is the code :

function Matrixsave(settings,imageName)
{
        savepath = path[0]+"\\"+path[1]+"\\XYfiles\\"+imageName+".txt";
        pathtest = path[0]+"\\"+path[1]+"\\XYfiles\\";
       
        if(File.exists(pathtest))
        {
                print("folder found at "+pathtest);
        }
        else
        {
                print("folder not found at "+pathtest);
        }


                run("Save XY Coordinates...", "background=255 save="+savepath);
                print("XY file saved at "+savepath);
}

The different prints give me the correct answers i.e. the folder indeed exists and it writes that the file has been correctly saved at the correct position, but when I open the folder, not file is present...

Thanks a lot for your help !
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Herbie
Florian,

not sure what it is that you like to save, but if it is text then you
are to use:

        File.saveString(string, path);

HTH

Herbie

:::::::::::::::::::::::::::::::::::
Am 04.08.15 um 14:37 schrieb Flopi:

> Hi,
> There is most probably a very obvious answer to my question, but I can't
> definitely find it. Moreover, it worked at some point, and I don't remember
> changing anything about the part of the code. My goal is, after doing some
> work on images, to record the XY coordinates of the final image. The problem
> is, everything goes normally, the log is ok, but at the end, no file is
> saved. I have been on it for some hours now and I have no idea what is going
> wrong.
>
> Below is the code :
>
> function Matrixsave(settings,imageName)
> {
> savepath = path[0]+"\\"+path[1]+"\\XYfiles\\"+imageName+".txt";
> pathtest = path[0]+"\\"+path[1]+"\\XYfiles\\";
>
> if(File.exists(pathtest))
> {
> print("folder found at "+pathtest);
> }
> else
> {
> print("folder not found at "+pathtest);
> }
>
>
> run("Save XY Coordinates...", "background=255 save="+savepath);
> print("XY file saved at "+savepath);
> }
>
> The different prints give me the correct answers i.e. the folder indeed
> exists and it writes that the file has been correctly saved at the correct
> position, but when I open the folder, not file is present...
>
> Thanks a lot for your help !
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Saving-XY-files-tp5013884.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Flopi
Hi,
I want to use the tool save XY coordinates (Analyze>Tools>save XY coordinates) in order to import it in Origin and then work on it (especially, to make some fits).
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Herbie
Florian,

well that's a different story then...

This works for me, but I'm working on OSX:

run("Save XY Coordinates...", "background=254
save=/Folder_1/Folder_2/FluorescentCells.txt");

Make sure that your "path[0]" is recognized as a directory.

HTH

Herbie

:::::::::::::::::::::::::::::::::::
Am 04.08.15 um 16:01 schrieb Flopi:

> Hi, I want to use the tool save XY coordinates (Analyze>Tools>save
> XY coordinates) in order to import it in Origin and then work on it
> (especially, to make some fits).
>
>
>
> -- View this message in context:
> http://imagej.1557.x6.nabble.com/Saving-XY-files-tp5013884p5013886.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Krs5
In reply to this post by Flopi
Is it possible you have spaces in the file name? If so, you need: run("Save XY Coordinates...", "background=255 save=["+savepath+"]");
Kees

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Flopi
Sent: 04 August 2015 15:02
To: [hidden email]
Subject: Re: Saving XY files

Hi,
I want to use the tool save XY coordinates (Analyze>Tools>save XY
coordinates) in order to import it in Origin and then work on it (especially, to make some fits).



--
View this message in context: http://imagej.1557.x6.nabble.com/Saving-XY-files-tp5013884p5013886.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Michael Schmid
In reply to this post by Flopi
Hi Flopi,

maybe your name and/or path contains a space? Then put it into square brackets.
  run("Save XY Coordinates...", "background=255 save=["+savepath+"]");

It won't work if your imageName contains a character that is forbidden in Windows file names:  " * : < > ? \ / |
Also, invisible characters ("gremlins"), e.g. ascii codes 0-31 dec are forbidden and you can't save a file with any of these in the name.


Michael
________________________________________________________________
On Aug 4, 2015, at 14:37, Flopi wrote:

> Hi,
> There is most probably a very obvious answer to my question, but I can't
> definitely find it. Moreover, it worked at some point, and I don't remember
> changing anything about the part of the code. My goal is, after doing some
> work on images, to record the XY coordinates of the final image. The problem
> is, everything goes normally, the log is ok, but at the end, no file is
> saved. I have been on it for some hours now and I have no idea what is going
> wrong.
>
> Below is the code :
>
> function Matrixsave(settings,imageName)
> {
> savepath = path[0]+"\\"+path[1]+"\\XYfiles\\"+imageName+".txt";
> pathtest = path[0]+"\\"+path[1]+"\\XYfiles\\";
>
> if(File.exists(pathtest))
> {
> print("folder found at "+pathtest);
> }
> else
> {
> print("folder not found at "+pathtest);
> }
>
>
> run("Save XY Coordinates...", "background=255 save="+savepath);
> print("XY file saved at "+savepath);
> }
>
> The different prints give me the correct answers i.e. the folder indeed
> exists and it writes that the file has been correctly saved at the correct
> position, but when I open the folder, not file is present...
>
> Thanks a lot for your help !
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Saving-XY-files-tp5013884.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
Reply | Threaded
Open this post in threaded view
|

Re: Saving XY files

Flopi
There was indeed a space in the name. Now it works perfectly
Thanks a lot for help !