4Quant / COPD-staging

Package of tools to quantify lung disease (COPD) using any number of popular medical quantifiers (PD15, LAA-x...)
1 stars 0 forks source link

Test RIQAE against Research PACS #83

Open drtjre opened 8 years ago

drtjre commented 8 years ago

At USB, there is a "Research PACS" to which we have full access. Establish that RIQAE is working against the Research PACS from networked computer PolarBear.

drtjre commented 8 years ago

From PolarBear, the following FINDSCU command produces successful results:

findscu   -b YETI -c GRASP_SERVER@10.5.66.120:4100    -r PatientID -r StudyDate -r StudyDescription -r StudyInstanceUID  -m 00080052="STUDY"  -m PatientID=USB0003510658

The equivalent from RIQAE produces connection error: called-AE-title-not-recognized

0: jdbc:hive2://127.0.0.1:8000/> CREATE TEMPORARY TABLE Stolz3 USING fourquant.pacs OPTIONS (bind "YETI", username "GRASP_SERVER", server "10.5.66.120", port "4100", path "stolz3grasp.csv");
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.251 seconds)
0: jdbc:hive2://127.0.0.1:8000/> describe Stolz3;
+--------------------+----------------+----------+--+
|      col_name      |   data_type    | comment  |
+--------------------+----------------+----------+--+
| patientName        | string         |          |
| patientID          | string         |          |
| studyInstanceUID   | string         |          |
| studyDate          | string         |          |
| studyDescription   | string         |          |
| seriesInstanceUID  | string         |          |
| seriesDescription  | string         |          |
| result             | string         |          |
| cmd_history        | array<string>  |          |
| status             | string         |          |
| success            | boolean        |          |
+--------------------+----------------+----------+--+
11 rows selected (0.053 seconds)
0: jdbc:hive2://127.0.0.1:8000/> select patientID,studyDate,studyDescription FROM Stolz3 where success=true;

findscu: A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
    at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:182)
    at org.dcm4che3.net.Association$2.run(Association.java:478)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
Error: org.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe (state=08S01,code=0)
0: jdbc:hive2://127.0.0.1:8000/> MC526512:riqae pacs$ 
drtjre commented 8 years ago

Tried performing a fetch command to provoke debug info about the GETSCU. No info was displayed.

0: jdbc:hive2://127.0.0.1:8000/> CREATE TEMPORARY TABLE Stolz3 USING fourquant.pacs OPTIONS (bind "YETI", username "GRASP_SERVER", server "10.5.66.120", port "4100", path "stolz3grasp.csv");
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.256 seconds)
0: jdbc:hive2://127.0.0.1:8000/> 
0: jdbc:hive2://127.0.0.1:8000/> 
0: jdbc:hive2://127.0.0.1:8000/> select patientname,seriesDescription,nslices(fetch_dicom_imagej(studyInstanceUID,seriesInstanceUID)) from Stolz3  WHERE success=true; 
findscu: A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
    at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:182)
    at org.dcm4che3.net.Association$2.run(Association.java:478)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
Error: org.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe (state=08S01,code=0)
drtjre commented 8 years ago

waiting KevM to produce more verbose version of RIQAE to better understand the FINDSCU/GETSCU call which is being performed.

drtjre commented 8 years ago

Got Verbose version. Testing.

Example:

0: jdbc:hive2://127.0.0.1:8000/> CREATE TEMPORARY TABLE Stolz3 USING fourquant.pacs OPTIONS (bind "YETI", username "GRASP_SERVER", server "10.5.66.120", port "4100", path "stolz3grasp.csv");
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.273 seconds)
0: jdbc:hive2://127.0.0.1:8000/> 
0: jdbc:hive2://127.0.0.1:8000/> 
0: jdbc:hive2://127.0.0.1:8000/> select patientname,seriesDescription from stolz3;
Calling:public static void org.dcm4che3.tool.findscu.FindSCU.main(java.lang.String[]) ( -r PatientID -c grasp_server@10.5.66.120:4100 -b yeti -m PatientName=XXXX --out-dir /var/folders/nc/d80ztjxj0jz0j3_45p8x3z180000gn/T/integrationTest-temp-9007680638531317040 --xml)
findscu: A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
    at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:182)
    at org.dcm4che3.net.Association$2.run(Association.java:478)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
Error: org.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe (state=08S01,code=0)
>FindSCU -r PatientID -c grasp_server@10.5.66.120:4100 -b yeti -m PatientName=XXXX --out-dir /var/folders/nc/d80ztjxj0jz0j3_45p8x3z180000gn/T/integrationTest-temp-
09:48:20,078 INFO  - Initiate connection from 0.0.0.0/0.0.0.0:0 to 10.5.66.120:4100
09:48:20,086 INFO  - Established connection Socket[addr=/10.5.66.120,port=4100,localport=49249]
09:48:20,095 DEBUG - /10.40.38.52:49249->/10.5.66.120:4100(1): enter state: Sta4 - Awaiting transport connection opening to complete
09:48:20,095 INFO  - yeti->grasp_server(1) << A-ASSOCIATE-RQ
09:48:20,103 DEBUG - A-ASSOCIATE-RQ[
  calledAET: grasp_server
  callingAET: yeti
  applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
  implClassUID: 1.2.40.0.13.1.1
  implVersionName: dcm4che-3.3.7
  maxPDULength: 16378
  maxOpsInvoked/maxOpsPerformed: 0/0
  PresentationContext[id: 1
    as: 1.2.840.10008.5.1.4.1.2.2.1 - Study Root Query/Retrieve Information Model - FIND
    ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
    ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
    ts: 1.2.840.10008.1.2.2 - Explicit VR Big Endian (Retired)
  ]
]
09:48:20,103 DEBUG - yeti->grasp_server(1): enter state: Sta5 - Awaiting A-ASSOCIATE-AC or A-ASSOCIATE-RJ PDU
09:48:20,107 INFO  - yeti->grasp_server(1) >> A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
09:48:20,107 INFO  - yeti->grasp_server(1): close Socket[addr=/10.5.66.120,port=4100,localport=49249]
09:48:20,107 DEBUG - yeti->grasp_server(1): enter state: Sta1 - Idle
findscu: A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
A-ASSOCIATE-RJ[result: 1 - rejected-permanent, source: 1 - service-user, reason: 7 - called-AE-title-not-recognized]]
    at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:182)
    at org.dcm4che3.net.Association$2.run(Association.java:478)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
FindSCU -r PatientID -c GRASP_SERVER@10.5.66.120:4100 -b yeti -m PatientName=XXXX --out-dir /var/folders/nc/d80ztjxj0jz0j3_45p8x3z180000gn/T/integrationTest-temp-9007680638531317040 --xml
09:54:17,849 INFO  - Initiate connection from 0.0.0.0/0.0.0.0:0 to 10.5.66.120:4100
09:54:17,857 INFO  - Established connection Socket[addr=/10.5.66.120,port=4100,localport=49258]
09:54:17,864 DEBUG - /10.40.38.52:49258->/10.5.66.120:4100(1): enter state: Sta4 - Awaiting transport connection opening to complete
09:54:17,865 INFO  - yeti->GRASP_SERVER(1) << A-ASSOCIATE-RQ
09:54:17,872 DEBUG - A-ASSOCIATE-RQ[
  calledAET: GRASP_SERVER
  callingAET: yeti
  applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
  implClassUID: 1.2.40.0.13.1.1
  implVersionName: dcm4che-3.3.7
  maxPDULength: 16378
  maxOpsInvoked/maxOpsPerformed: 0/0
  PresentationContext[id: 1
    as: 1.2.840.10008.5.1.4.1.2.2.1 - Study Root Query/Retrieve Information Model - FIND
    ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
    ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
    ts: 1.2.840.10008.1.2.2 - Explicit VR Big Endian (Retired)
  ]
]
09:54:17,872 DEBUG - yeti->GRASP_SERVER(1): enter state: Sta5 - Awaiting A-ASSOCIATE-AC or A-ASSOCIATE-RJ PDU
09:54:17,876 INFO  - yeti->GRASP_SERVER(1) >> A-ASSOCIATE-AC
09:54:17,876 DEBUG - A-ASSOCIATE-AC[
  calledAET: GRASP_SERVER
  callingAET: yeti
  applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
  implClassUID: 1.2.40.0.13.1.1.1
  implVersionName: dcm4che-1.4.29
  maxPDULength: 16352
  maxOpsInvoked/maxOpsPerformed: 1/1
  PresentationContext[id: 1
    result: 0 - acceptance
    ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
  ]
]
09:54:17,876 DEBUG - yeti->GRASP_SERVER(1): enter state: Sta6 - Association established and ready for data transfer
09:54:17,881 INFO  - yeti->GRASP_SERVER(1) << 1:C-FIND-RQ[pcid=1, prior=0
  cuid=1.2.840.10008.5.1.4.1.2.2.1 - Study Root Query/Retrieve Information Model - FIND
  tsuid=1.2.840.10008.1.2 - Implicit VR Little Endian
09:54:17,896 DEBUG - Command:
(0000,0002) UI [1.2.840.10008.5.1.4.1.2.2.1] AffectedSOPClassUID
(0000,0100) US [32] CommandField
(0000,0110) US [1] MessageID
(0000,0700) US [0] Priority
(0000,0800) US [0] CommandDataSetType

09:54:17,896 DEBUG - Dataset:
(0008,0052) CS [STUDY] QueryRetrieveLevel
(0010,0010) PN [XXXX] PatientName
(0010,0020) LO [] PatientID

09:54:17,906 INFO  - yeti->GRASP_SERVER(1) >> 1:C-FIND-RSP[pcid=1, status=0H
  cuid=1.2.840.10008.5.1.4.1.2.2.1 - Study Root Query/Retrieve Information Model - FIND
  tsuid=1.2.840.10008.1.2 - Implicit VR Little Endian
09:54:17,906 DEBUG - Command:
(0000,0002) UI [1.2.840.10008.5.1.4.1.2.2.1] AffectedSOPClassUID
(0000,0100) US [32800] CommandField
(0000,0120) US [1] MessageIDBeingRespondedTo
(0000,0800) US [257] CommandDataSetType
(0000,0900) US [0] Status

09:54:17,907 INFO  - yeti->GRASP_SERVER(1) << A-RELEASE-RQ
09:54:17,907 DEBUG - yeti->GRASP_SERVER(1): enter state: Sta7 - Awaiting A-RELEASE-RP PDU
09:54:17,908 INFO  - yeti->GRASP_SERVER(1) >> A-RELEASE-RP
09:54:17,908 INFO  - yeti->GRASP_SERVER(1): close Socket[addr=/10.5.66.120,port=4100,localport=49258]
09:54:17,908 DEBUG - yeti->GRASP_SERVER(1): enter state: Sta1 - Idle
drtjre commented 8 years ago

Conclusion:

Called PACS node AET value is CASE_SENSITIVE! This may be PACS dependent (it looks like it was not case sensitive for the OSIRIX PACS).

Solution: While the GRASP_SERVER is very liberal with caller AET values, other PACS servers may not be so. For safety, maintain case of both caller and called AET: -c -b parameters.

kmader commented 8 years ago

Temporary solution will have everything as uppercase (since neither Hive nor SSQL are case sensitive for these commands)

drtjre commented 8 years ago

Uppercase will work with all of the PACS's with which I am now familiar (GE, GE_ARCH, GRASP_SERVER/USB_RESEARCH_PACS). I suspect upper case is the standard for AET's. Likely an option in the PACS configuration, but it would make sense that the "convention" is uppercase.

kmader commented 8 years ago

force_uppercase is by default true but can be controlled by the CREATE USING command

 CREATE TEMPORARY TABLE Stolz3 USING fourquant.pacs OPTIONS (bind "YETI", username "GRASP_SERVER", server "10.5.66.120", port "4100", path "stolz3grasp.csv", force_uppercase "true");
drtjre commented 8 years ago

It appears that the latest version of riqae is passing -c and -b arguments as UPPERCASE, which should resolve the problem. Needs to be tested from within USB against the GRASP_SERVER to close issue. Will do so next Wed June 1.