cannot export postscript

Post Reply
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

cannot export postscript

Post by patoorio »

Hi,

Postscript export is giving me an empty file, and I get the messagse

Code: Select all

oc>system("command")"sed" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.
which roughly translates as
system("command")"sed" not recognized as a command, blah blah blah...

My version is a MinGW32 version (i686), the only one so far that I can import into python under Windows
NEURON -- Release 7.3 (901:c736db45853d) 2013-06-29

Is this a version-specific bug?

Thanks
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: cannot export postscript

Post by ted »

Before deciding that there's a bug, I should make sure that you followed the correct procedure to generate a Postscript file.

The Print & File Window Manager actually offers two ways to generate Postscript files. The one I use most often is Print / Postscript which immediately generates a Postscript file that contains images of the windows that appear in the PFWM's "page layout area," but without their OS-generated frames or drag bars. Of course, before you do this, you have to select the windows that you want to print (click on the PFWM's "select" radio button, then click inside the windows you want in the PFWM's "virtual screen", then click on the PFWM's "move" radio button, and finally drag the selected windows into the page layout area).

The other way is Print / PS snapshot, which generates a Postscript file that contains images of every NEURON window. The way this works is
1. first you click on Print / PS snapshot, and a "file browser" tool pops up
2. at the top of this tool is a text entry area where you type the name of the file you want to generate--for example ./pssnap.ps
3. click on the Print to file button at the bottom of the tool. The file will be created, but it will be empty.
4. click on any of NEURON's GUI windows, then press the "p" on your keyboard. This makes NEURON write Postscript to your file. Every GUI window will be there, even if you can't see it because it lies outside the bounding box of a standard page. And each window will appear to have a frame and drag bar, along with the "Close" and "Hide" buttons, looking very much like a screenshot (except that it's a vector-based image, not a screenshot bitmap). In order to see the windows that lie outside the page bounding box, it is necessary to edit the Postscript file manually; this is a nuisance, and that's why I don't use Print / PS snapshot much.

Finally, I should mention Print / Idraw, which generates an Idraw file that contains just the graphs from the selected windows. Idraw files are encapsulated Postscript files that are editable with Idraw. When the PFWM generates an Idraw file, all of the selected graphs are piled up on top of each other in the middle of the page. It is easy to use Idraw to drag these graphs apart, position them nicely, change line styles and colors, and add text annotations. Idraw works under Linux, but I don't think it's available under MSWin, and don't know if it works under OS X.
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: cannot export postscript

Post by patoorio »

Hi Ted

Yes, I think I'm doing it the right way, sorry for not giving more details about what I was doing. Actually I was trying the first option, Print/Postscript, after selecting a window and seeing it appear in the page layout and adjusting its size and position. BTW I could successfully do the export in a Liunx machine so I really know how to do it. I don't see the Print/PS snapshot option, I don't remember right now wether it is present in Linux. And the Print/Idraw thing works, I get a non-empty file, but I don't have a clue about what to open it with.
Remember that I'm getting the message ' "sed" is not recognized as a command' or something like that. But that happens only with postscript.

EDIT: I added "C:\nrn73w\mingw\bin" to the PATH and sed now appear to start. But now I have the following message:

Code: Select all

sed: couldn't open file $N/lib/psfilt.sed: No such file or directory
I fact, I can't find psfilt.sed and I don't know where it should be.

EDIT 2: i already tried changing "*pwm_postscript_filter: sed -f ${N}/lib/psfilt.sed" to "*pwm_postscript_filter: sed -f $N/lib/psfilt.sed" in nrn.def, but it didn't help

Regards
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: cannot export postscript

Post by ted »

patoorio wrote:I really know how to do it.
Yes, but others who read this thread may not, so I often include additional information.
I don't see the Print/PS snapshot option
It does exist under Linux.
the Print/Idraw thing works, I get a non-empty file, but I don't have a clue about what to open it with.
Under Linux, if you used one of NEURON's installers or compiled from source code and built InterViews, you'd use idraw (not to be confused with the much more powerful iPad app called iDraw). The question is where it's located, but that's easy to discover because it's usually similar to the path to NEURON's executables; on my machine NEURON's executables are in /usr/local/nrn/i686/bin, and idraw is in /usr/local/iv/i686/bin.

Adobe Illustrator and Corel Draw can also edit idraw files.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: cannot export postscript

Post by hines »

edit the file c:/nrn73w/lib/nrn.def and change the line
*pwm_postscript_filter: sed -f ${N}/lib/psfilt.sed
to
*pwm_postscript_filter: c:\\nrn73w\\mingw\\bin\\sed -f c:/nrn73w/lib/psfilt.sed

I'll need to investigate why the PATH and N are not set properly when the filter command is executed.
Note: I assume you installed in the default location c:/nrn73w. If that is not the case, modify the paths accordingly.
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: cannot export postscript

Post by patoorio »

Thanks a lot!!
That did it.
neuromau
Posts: 97
Joined: Mon Apr 20, 2009 7:02 pm

Re: cannot export postscript

Post by neuromau »

I've been able to reproduce this error if I run a hoc file from the command line, but not if I run that same hoc file from within the GUI. I'm in Windows 8 with cygwin, NEURON 7.3.

I have a hoc (printCell.hoc) file that contains:

Code: Select all

objref ss
ss = new Shape(cell.all)
ss.printfile("mycellview.ps")

This errors:

Code: Select all

$ nrniv printCell.hoc
/usr/bin/sed: couldn't open file /lib/psfilt.sed: No such file or directory
This does not error:
1. Open nrngui
2. Select working directory
3.

Code: Select all

oc>load_file("printCell.hoc")

If I apply the fix suggested by Michael, then I can run the hoc file from the command line without error:

Code: Select all

//*pwm_postscript_filter: sed -f ${N}/lib/psfilt.sed
*pwm_postscript_filter: /cygdrive/c/nrn73/bin/sed -f c:/nrn73/lib/psfilt.sed
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: cannot export postscript

Post by hines »

I believe the underlying problem is that the cygwin program, cygpath.exe, does not seem to produce any result on windows 8. So the work around for now is to substitute /cygdrive/c/nrn73
(or whereever one installed NEURON) anywhere there is a problem with $N
It may suffice for most purposes to do this in c:/nrn73/lib/neuron.sh, ie.

N="`$1/bin/cygpath -u $1`"
N="/cygdrive/c/nrn73" # or perhaps, even more generally N="$1"

...
ARG="`cygpath -u $1`"
ARG="$1"
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: cannot export postscript

Post by hines »

I've been doing a bit of experimenting and it may be that cygpath is not working because of something wrong with mydistributed version of c:/nrn73/bin/USERENV.dll
try moving that file to another name such as USERENV.dll.old and see if that fixes the problem.
Post Reply