How resolve this problem?

312 views
Skip to first unread message

KIRA KUCHIKI CLOVERFIELD

unread,
Aug 5, 2011, 5:16:26 PM8/5/11
to ruby-dicom
Bien, I try connect for PACS using this values:
port = 11112,host_ip = 127.0.0.1 || 192.168.1.87 and ae =
'PACSINMOVIL'
I write the sintaxis for Dclient specify in the gem ruby Dicom


> node = DICOM::DClient.new('127.0.0.1',11112,:ae=>'PACSINMOVIL')

=> #<DICOM::DClient:0x10333cc88 @link=#<DICOM::Link:0x103333f20
@host_ae="DEFAULT", @transfer_syntax="1.2.840.10008.1.2",
@explicit=false, @session=nil, @min_length=10,
@file_handler=DICOM::FileHandler, @net_endian=true, @release=nil,
@ae="PACSINMOVIL", @outgoing=#<DICOM::Stream:0x10332b320 @string="",
@fs="g*", @str_endian=true, @us="n*", @equal_endian=false, @index=0,
@sl="r*", @pad_byte={"SS"=>"\000", "UL"=>"\000", "OF"=>"\000", "ST"=>"
", "UN"=>"\000", "SL"=>"\000", "TM"=>" ", "LO"=>" ", "DS"=>" ",
"AE"=>" ", "DT"=>" ", "CS"=>" ", "FL"=>"\000", "DA"=>" ", "AS"=>" ",
"US"=>"\000", "SQ"=>"\000", "OW"=>"\000", "OB"=>"\000", "FD"=>"\000",
"AT"=>"\000", "PN"=>" ", "LT"=>" ", "UI"=>"\000", "UT"=>" ", "SH"=>"
", "IS"=>" "}, @hex="H*", @by="C*", @str="a*", @ul="N*",
@format={"SS"=>"k*", "ST"=>"a*", "OF"=>"g*", "UL"=>"N*", "BY"=>"C*",
"TM"=>"a*", "LO"=>"a*", "UN"=>"H*", "SL"=>"r*", "DS"=>"a*",
"AE"=>"a*", "DT"=>"a*", "CS"=>"a*", "HEX"=>"H*", "STR"=>"a*",
"FL"=>"g*", "DA"=>"a*", "AS"=>"a*", "PN"=>"a*", "LT"=>"a*",
"AT"=>"H*", "OW"=>"n*", "OB"=>"C*", "FD"=>"G*", "US"=>"n*",
"UT"=>"a*", "UI"=>"a*", "SH"=>"a*", "IS"=>"a*"}, @fd="G*", @errors=[],
@ss="k*">, @request_approved=nil, @timeout=10,
@max_receive_size=32768, @user_information=[["51", "UL", 32768],
["52", "STR", "1.2.826.0.1.3680043.8.641"], ["55", "STR",
"RUBY_DCM_0.9.1"]], @association=nil, @verbose=true,
@max_package_size=32768, @data_endian=false,
@presentation_contexts={}, @errors=[], @command_request={},
@notices=[]>, @host_ae="DEFAULT", @port=11112, @data_elements=[],
@min_length=12, @release=nil, @ae="PACSINMOVIL",
@request_approved=nil, @timeout=10, @user_information=[["51", "UL",
32768], ["52", "STR", "1.2.826.0.1.3680043.8.641"], ["55", "STR",
"RUBY_DCM_0.9.1"]], @data_results=[], @host_ip="127.0.0.1",
@association=nil, @verbose=true, @max_package_size=32768,
@command_results=[], @errors=[], @notices=[]>

and obtain this msg when run node.test

>> node.test
TESTING CONNECTION...
Warning: ASSOCIATE Request was rejected by the host. Error codes:
Result: 1, Source: 1, Reason: 7 (See DICOM PS3.8: Table 9-21 for
details.)
Association was denied from host DEFAULT (127.0.0.1)!
TEST FAILED!
=> false

then i try modify the host_ae DEFAULT by the same IP or the Server
localhost || PACSINMOVIL

?> node.host_ae = 'localhost'
=> "localhost"
>> node.test
TESTING CONNECTION...
Warning: ASSOCIATE Request was rejected by the host. Error codes:
Result: 1, Source: 1, Reason: 7 (See DICOM PS3.8: Table 9-21 for
details.)
Association was denied from host localhost (127.0.0.1)!
TEST FAILED!
=> false
>> node.host_ae = 'PACSINMOVIL'
=> "PACSINMOVIL"
>> node.test
TESTING CONNECTION...
Warning: ASSOCIATE Request was rejected by the host. Error codes:
Result: 1, Source: 1, Reason: 7 (See DICOM PS3.8: Table 9-21 for
details.)
Association was denied from host PACSINMOVIL (127.0.0.1)!
TEST FAILED!
=> false

and then how the connect for this PACS? , I view the PACS and obtained
the AE TITLE = 'PACSINMOVIL' and run in the port=>11112

KIRA KUCHIKI CLOVERFIELD

unread,
Aug 5, 2011, 7:58:27 PM8/5/11
to ruby-dicom
Hi, I try and try,finish encounter this solution for this error, I
read lastest post in this group and solve the error for other
user,then the key is the host_ae.The solve for the connection is
simple ( i used Jboss DCM4CHEE and WADO SERVER and other PACS with
ruby): the solutin its:
node = DICOM::Dclient.new('192.168.1.64',
11112,:ae=>'ANY',:host_ae=>'PACSINMOVIL')

node.test
ok
node.echo
Conection Sucesfull

now How implement get_image()??

Christoffer Lervåg

unread,
Aug 6, 2011, 5:40:01 AM8/6/11
to ruby-...@googlegroups.com
Hi Kira

Happy to hear that you solved your problem. Issues like these you
really have to solve on your own, because it is near impossible for
anyone else to know the configuration of your PACS.

Im afraid the method
DClient#get_image()
may not work. This is because I have never had a PACS that supports
the C-GET operation. You can try it of course but be prepared that it
is not working.

If you want to get dicom files from a server, you can try another
solution, using the C-MOVE operation:

1. Set up a DServer with ruby-dicom.
2. Use DClient#move_image() or DClient#move_study(), and specify your
DServer instance as your destination.
3. The PACS will send the DICOM images to your DServer.

Chris

KIRA KUCHIKI CLOVERFIELD

unread,
Aug 6, 2011, 9:55:27 PM8/6/11
to ruby-dicom
This msg send the console of ruby

>> node.get_image('public/images/temp','0008,0018'=>'1.2.840.113543.6.6.3.8.676110633314496800971123343199476961065') Warning: DICOM Request was rejected by the host, reason: 'Abstract syntax not supported'
Association successfully negotiated with host PACSINMOVIL
(192.168.1.64).
One or more of your presentation contexts were denied by host
PACSINMOVIL!
REJECTED: Study Root Query/Retrieve Information Model - GET (Implicit
VR Little Endian: Default Transfer Syntax for DICOM)
Association released properly from host PACSINMOVIL.
=> false

Other option
>> node.get_image('public/images/temp','0008,0052'=>'GET','0008,0018'=>'1.2.840.113543.6.6.3.8.676110633314496800971123343199476961065')
Warning: DICOM Request was rejected by the host, reason: 'Abstract
syntax not supported'
Association successfully negotiated with host PACSINMOVIL
(192.168.1.64).
One or more of your presentation contexts were denied by host
PACSINMOVIL!
REJECTED: Study Root Query/Retrieve Information Model - GET (Implicit
VR Little Endian: Default Transfer Syntax for DICOM)
Association released properly from host PACSINMOVIL.
=> false

Other aclaration is when make instance of DObject
>> obj = DICOM::DObject.new('public/images/node1.dcm')=> {"0029,1134"=>nil, "Samples per Pixel"=>1, "Position Reference Indicator"=>nil, "Image Position (Patient)"=>"-174.6640625\\-351.6640625\\-247.5", "Content Date"=>"20100715", "KVP"=>"130", "Series Time"=>"180013.718000", "Acquisition Time"=>"180218.994499", "Distance Source to Detector"=>"940", "Source Image Sequence"=>{"Item 0"=>{"Referenced SOP Class UID"=>"1.3.12.2.1107.5.9.1", "Referenced SOP Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001723"}}, "File Meta Information Group Length"=>204, "Largest Image Pixel Value"=>2145, "Patient's Name"=>"MENDOZA^EVANGELINA", "Source Application Entity Title"=>"OsiriX", "Date of Last Calibration"=>"20100715", "Performing Physician's Name"=>"DR. OSORIO", "Pixel Spacing"=>"0.671875\\0.671875", "0021,0010"=>nil, "Series Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001724", "Referenced Image Sequence"=>{"Item 0"=>{"Referenced SOP Class UID"=>"1.2.840.10008.5.1.4.1.1.2", "Referenced SOP Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001662"}}, "Exposure Time"=>"600", "Rows"=>512, "Photometric Interpretation"=>"MONOCHROME2", "Table Height"=>"180", "0019,0010"=>nil, "Window Center & Width Explanation"=>"WINDOW1\\WINDOW2", "Institution Name"=>"C M N 20 NOVIEMBRE", "Slice Location"=>"-247.5", "SOP Class UID"=>"1.2.840.10008.5.1.4.1.1.2", "Patient's Birth Date"=>"19460715", "Rescale Intercept"=>"-1024", "Image Type"=>"ORIGINAL\\PRIMARY\\AXIAL\\CT_SOM5 SPI", "Content Time"=>"180218.994499", "Gantry/Detector Tilt"=>"0", "Encapsulated Pixel Data"=>{"Item 0"=>{"Item 0"=>{"Pixel Data Item"=>nil}}}, "0019,1090"=>nil, "Manufacturer's Model Name"=>"Emotion 6", "Implementation Class UID"=>"1.3.6.1.4.1.19291.2.1", "Data Collection Diameter"=>"500.084", "Pixel Representation"=>0, "Frame of Reference UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001661", "Media Storage SOP Class UID"=>"1.2.840.10008.5.1.4.1.1.2", "Accession Number"=>nil, "Institution Address"=>"FELIX CUEVASMEXICO/DF592EE2TR/DFMEXICO", "Specific Character Set"=>"ISO_IR 100", "Window Center"=>"40\\-600", "0019,1092"=>nil, "Study Date"=>"20100715", "Patient's Age"=>"064Y", "Body Part Examined"=>"CHEST", "File Meta Information Version"=>nil, "Software Version(s)"=>"syngo CT 2006A", "Focal Spot(s)"=>"0.95", "Patient ID"=>"SOEJ460730", "Smallest Image Pixel Value"=>0, "High Bit"=>11, "0019,1093"=>nil, "Media Storage SOP Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001766", "Referring Physician's Name"=>nil, "Patient's Sex"=>"F", "Implementation Version Name"=>"OSIRIX001", "Bits Allocated"=>16, "Image Orientation (Patient)"=>"1\\0\\0\\0\\1\\0", "X-ray Tube Current"=>"69", "Manufacturer"=>"SIEMENS", "Slice Thickness"=>"5", "Series Date"=>"20100715", "Acquisition Date"=>"20100715", "Station Name"=>"CT44338", "Device Serial Number"=>"44338", "Time of Last Calibration"=>"145335.000000", "0021,1011"=>nil, "0019,10B0"=>nil, "Protocol Name"=>"Torax_Simple_Contraste", "Issuer of Patient ID"=>nil, "Filter Type"=>"1", "0029,1008"=>nil, "0029,0010"=>nil, "Lossy Image Compression Ratio"=>"5.345405", "Lossy Image Compression"=>"01", "Instance Number"=>"42", "Operators' Name"=>"T. R. ALINA", "Convolution Kernel"=>"B41s", "Series Description"=>"Torax CTE 5.0 B41s mediastino", "0029,1010"=>nil, "0029,1009"=>nil, "0029,0011"=>nil, "Rescale Slope"=>"1", "Acquisition Number"=>"3", "0019,1096"=>nil, "Exposure"=>"51", "Distance Source to Patient"=>"535", "Generator Power"=>"8", "Rotation Direction"=>"CW", "0029,1131"=>nil, "Window Width"=>"400\\1200", "Columns"=>512, "Series Number"=>"3", "Study Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514193451500000025", "Transfer Syntax UID"=>"1.2.840.10008.1.2.4.91", "Study Description"=>"T?rax^Torax_Simple_Contraste (Adulto)", "Modality"=>"CT", "0029,1132"=>nil, "Study ID"=>"1", "Reconstruction Diameter"=>"344", "Study Time"=>"175217.109000", "Patient Position"=>"HFS", "0029,1133"=>nil, "Bits Stored"=>12, "0009,0010"=>nil, "SOP Instance UID"=>"1.3.12.2.1107.5.1.4.44338.30000010071514223929600001766"}

>> obj.pixels
Warning: Decompressing the Pixel Data failed. Pixel values can not be
extracted.
=> false
>> obj.image
=> false
>> obj.narray
Warning: Decompressing the Pixel Data failed. Pixel values can not be
extracted.
=> false



Christoffer Lervåg

unread,
Aug 7, 2011, 5:18:11 AM8/7/11
to ruby-...@googlegroups.com
Kira,
see my previous post.
Your PACS does not support the C-GET operation.
Set up a DServer, configure your PACS so that it is aware of your DServer.
Use move_image() from DClient to make your PACS send images to your DServer.

Chris

KIRA KUCHIKI CLOVERFIELD

unread,
Aug 12, 2011, 7:01:25 PM8/12/11
to ruby-dicom
Then how create a DServer in the documentation this sintaxis is server
= DICOM::DServer.new(104, :host_ae => "RUBY_SERVER", :file_handler =>
DICOM::MyFileHandler) , this filehandler as configured in the same
documentation is not a concrete example, for example if I create a
server so serious dServer = DICOM: DServer.new (104,: host_ae =>
"myserver": file_handle => DICOM :: MyFileHandler) but MyFileHandler
get into, and to initialize it is to run or start_scp (path = '. /
received /'), this path is my own project or location of equipment.

Chris

unread,
Aug 12, 2011, 7:28:09 PM8/12/11
to ruby-...@googlegroups.com
Kira,
You can set up a DICOM server quite easily like this:

s = DServer.new(104, :host_ae => "MY_DICOM_SERVER")
s.start_scp("C:/temp/")

Then you need to configure your PACS so that your PACS is aware of this dicom server. You will need to set up things like IP address, AE title and port number.

You can easily test that it is working properly by sending dicom files to this dicom server, and see if the files are received.

However, since you are probably wanting to integrate this with your application (e.g. put incoming dicom files in a rails database or whatnot), you can create a modified FileHandler. Copy the file_handler.rb from the ruby-dicom directory and modify it to your needs, then load this local file handler when starting your DServer instance, as specified in the documentation:

  # Create a server and specify a host name as well as a custom built file handler:
  require 'MyFileHandler'
  server = DICOM::DServer.new(104, :host_ae => "RUBY_SERVER", :file_handler => DICOM::MyFileHandler)
Regards,
Chris

I-Ta Tsai

unread,
Jun 14, 2014, 9:25:25 AM6/14/14
to ruby-...@googlegroups.com
Hello Chris, 

I tried to integrate it with my RoR app. I have a customized file handler. What I want is to start a temporary SCP to receive DCM file from the PACS SCP by C-MOVE. But the question is if start_scp is excuted, it was stuck in the loop and how can I stop it in my file handler after receiving the files? Sending a message or something else?

Thank you very much.
tsaiid

Christoffer Lervåg於 2011年8月13日星期六UTC+8上午7時28分09秒寫道:
Reply all
Reply to author
Forward
0 new messages