I have written a Ruby script "dicom_info.rb", and when I try running
it, I get the following error. Why is that? And, how can it get
solved?
C:\Users\Abder-Rahman\Desktop\Research\dicom>ruby dicom_info.rb
Fantomas is 070Y
And, this is the DICOM image
dicom_info.rb:22:in `display': unable to open X server
`' (Magick::ImageMagickEr
ror)
from dicom_info.rb:22
from dicom_info.rb:10:in `each_index'
from dicom_info.rb:10
This is the "dicom_info,rb" script:
require "rubygems"
require "dicom"
require "RMagick"
dicom_files = Array.new
Dir["./dcm_files/*.dcm"].each do |dcm|
dicom_files << dcm
end
dicom_files.each_index do |i|
dcm = DICOM::DObject.new(dicom_files[i])
# Retrieve patient name value
patient_name = dcm.value("0010,0010")
patient_age = dcm.value("0010,1010")
print patient_name
print " "
print "is "
print patient_age
puts
puts "And, this is the DICOM image"
dicom_image = dcm.get_image_magick
dicom_image.display
end
Thanks.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
abder.rahman.ali (180)
|
9/6/2010 3:42:11 AM |
|
On Mon, Sep 06, 2010 at 12:42:11PM +0900, Abder-Rahman Ali wrote:
> I have written a Ruby script "dicom_info.rb", and when I try running
> it, I get the following error. Why is that? And, how can it get
> solved?
>
> C:\Users\Abder-Rahman\Desktop\Research\dicom>ruby dicom_info.rb
So I'm guessing you're running some version of ruby under some version of
windows.
> dicom_info.rb:22:in `display': unable to open X server
Well, do you have an X server? For example, are you running under cygwin?
It would be much more helpful if you could give the full context of where
you're running this.
* What O/S and version you're running under
* What ruby version you're running under, and where you got it from or
how you installed it (e.g. one-click installer, which version?)
* What versions of relevant library/ies
|
|
0
|
|
|
|
Reply
|
Brian
|
9/6/2010 8:19:34 AM
|
|
Thanks a lot Brian.
This is more information on my environment:
OS ---> Windows Vista Home Edition
Ruby version ---> ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
I installed this version of Ruby using RubyInstaller for Windows
http://www.rubyinstaller.org/
I just didn't understand those questions:
* Well, do you have an X server? For example, are you running under
cygwin?
* What versions of relevant library/ies
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
abder.rahman.ali (180)
|
9/6/2010 2:55:32 PM
|
|
On Mon, Sep 06, 2010 at 11:55:32PM +0900, Abder-Rahman Ali wrote:
> I installed this version of Ruby using RubyInstaller for Windows
> http://www.rubyinstaller.org/
>
> I just didn't understand those questions:
>
> * Well, do you have an X server? For example, are you running under
> cygwin?
An X server is the way that a Unix system talks to a graphical display. If
you've got code which expects to talk to an X server, then it'll fail if you
don't have one.
I'm pretty sure you get one with cygwin; I'd be surprised if the
RubyInstaller comes with one. However I'm not a Windows user, I just
occasionally look over people's shoulders :-)
|
|
0
|
|
|
|
Reply
|
Brian
|
9/6/2010 3:37:42 PM
|
|
So, do you suggest installing "cygwin"?
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
abder.rahman.ali (180)
|
9/6/2010 3:42:08 PM
|
|
> you suggest installing "cygwin"?
You won't be able to run this line:
"dicom_image.display"
without X installed. It'll be an uphill battle, either way, in windows.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Roger
|
9/6/2010 6:36:22 PM
|
|
Roger Pack wrote:
>> you suggest installing "cygwin"?
>
> You won't be able to run this line:
>
> "dicom_image.display"
>
> without X installed. It'll be an uphill battle, either way, in windows.
Got what you mean @Roger, so I'll go with installing Cygwin.
Thanks.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Abder
|
9/6/2010 8:09:25 PM
|
|
I have downloaded Cygwin, but still getting the following error:
C:\Users\Abder-Rahman\Desktop\Research\dicom>ruby dicom_info.rb
Fantomas is 070Y
And, this is the DICOM image
dicom_info.rb:22:in `display': unable to open X server `' @
display.c/DisplayIma
ges/1654 (Magick::ImageMagickError)
from dicom_info.rb:22
from dicom_info.rb:10:in `each_index'
from dicom_info.rb:10
Why is that? Is there a workaround for this?
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Abder
|
9/7/2010 1:52:27 AM
|
|
Abder-Rahman Ali wrote:
> I have downloaded Cygwin, but still getting the following error:
>
> C:\Users\Abder-Rahman\Desktop\Research\dicom>ruby dicom_info.rb
> Fantomas is 070Y
> And, this is the DICOM image
> dicom_info.rb:22:in `display': unable to open X server `' @
> display.c/DisplayIma
> ges/1654 (Magick::ImageMagickError)
> from dicom_info.rb:22
> from dicom_info.rb:10:in `each_index'
> from dicom_info.rb:10
>
> Why is that? Is there a workaround for this?
are you using cygwin ruby? do you have cygwin X package installed?
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Roger
|
9/7/2010 3:45:59 AM
|
|
Roger Pack wrote:
> are you using cygwin ruby? do you have cygwin X package installed?
And have you started a cygwin shell and typed "startx" ?
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Brian
|
9/7/2010 8:11:59 AM
|
|
Thanks for your replies.
@Roger, is there "Cygwin Ruby"? Is it different from "Cygwin"?
@Brian, no really I didn't do that, just new to this. So, "startx" has
to be run then if I need to use X Window? Got what you mean.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Abder
|
9/7/2010 10:25:15 AM
|
|
Brian Candler wrote:
> Roger Pack wrote:
>> are you using cygwin ruby? do you have cygwin X package installed?
>
> And have you started a cygwin shell and typed "startx" ?
I have started started a Cygwin shell and typed "startx", but got the
following:
bash: startx: command not found
Any ideas?
Thanks.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Abder
|
9/7/2010 10:30:24 AM
|
|
Hi Ali,
On 07.09.2010 12:30, Abder-Rahman Ali wrote:
> I have started started a Cygwin shell and typed "startx", but got the
> following:
>
> bash: startx: command not found
First Google result searching for "cygwin startx":
http://x.cygwin.com/docs/ug/using.html
Looks useful to me, mention you need to install the xinit package (and
probably others ... ), etc.
HTH
|
|
0
|
|
|
|
Reply
|
Markus
|
9/7/2010 11:20:11 AM
|
|
@Markus. Thanks for your reply.
I have installed "xinit".
Now, when I want to run "startx", I get the following:
Abder-Rahman@Abder-Rahman-PC ~
$ startx
xauth: creating new authority file /home/Abder-Rahman/.serverauth.1188
xinit: Resource temporarily unavailable (errno 11): Another X server
instance is running on DISPLAY :0
Why is that?
Thanks.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
abder.rahman.ali (180)
|
9/8/2010 6:06:33 AM
|
|
Hi Ali,
On 08.09.2010 08:06, Abder-Rahman Ali wrote:
> I have installed "xinit".
>
> Now, when I want to run "startx", I get the following:
>
> Abder-Rahman@Abder-Rahman-PC ~
> $ startx
> xauth: creating new authority file /home/Abder-Rahman/.serverauth.1188
> xinit: Resource temporarily unavailable (errno 11): Another X server
> instance is running on DISPLAY :0
>
> Why is that?
The error message indicated that "another X server instance is running",
have you checked that?
Accidentally I installed cygwin with X today and it worked out of the
box (W7 Pro x64).
HTH
|
|
0
|
|
|
|
Reply
|
Markus
|
9/8/2010 10:30:56 AM
|
|
Markus Fischer wrote:
> Hi Ali,
>
> On 08.09.2010 08:06, Abder-Rahman Ali wrote:
>> Why is that?
> The error message indicated that "another X server instance is running",
> have you checked that?
>
> Accidentally I installed cygwin with X today and it worked out of the
> box (W7 Pro x64).
>
> HTH
Yes, I checked that and didn't notice any other instance running.
Maybe I'm missing something.
I'm trying to do CTRL-ALT-DELETE at Windows Vista to check what programs
are running but seems there to be a problem.
Thanks.
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Abder
|
9/8/2010 1:55:50 PM
|
|
|
15 Replies
658 Views
(page loaded in 0.184 seconds)
|