Difference between revisions of "CTSC Slicer XNE"

From NAMIC Wiki
Jump to: navigation, search
Line 69: Line 69:
 
* Subject: { All SubjectIDs} (eventually a checkbox for "include shared subjects")
 
* Subject: { All SubjectIDs} (eventually a checkbox for "include shared subjects")
 
* Experiments: { All ExperimentIDs } (eventually a checkbox for "include shared experiments")
 
* Experiments: { All ExperimentIDs } (eventually a checkbox for "include shared experiments")
** Imaging Sessions: { }
+
** Scans: { }
*** Scans: { }
+
** Reconstructions: { }
*** Reconstructions: { }
+
** Assessors: { }
*** Assessors: { }
 
 
** Non-imaging Assessments: { }
 
** Non-imaging Assessments: { }
  
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects?format=xml --cookie JSESSIONID=$sessionID
+
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects?format=xml --cookie JSESSIONID=$JsessionID
 
  '''parse response''' into list of SubjectIDs
 
  '''parse response''' into list of SubjectIDs
 
  for each id in list of SubjectIDs
 
  for each id in list of SubjectIDs
 
  {
 
  {
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments?format=xml --cookie JSESSIONID=$SessionID
+
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments?format=xml --cookie JSESSIONID=$JSessionID
 
   '''parse response''' and add to list of ExperimentIDs
 
   '''parse response''' and add to list of ExperimentIDs
 
  }
 
  }
Line 88: Line 87:
 
* Subject: $SubjectID
 
* Subject: $SubjectID
 
* Experiments:  { All for $SubjectID }
 
* Experiments:  { All for $SubjectID }
** Imaging Sessions: { All for $SubjectID }
+
** Scans: { Allfor $SubjectID }  
*** Scans: { Allfor $SubjectID }  
+
** Reconstructions: { All for $SubjectID }
*** Reconstructions: { All for $SubjectID }
+
** Assessors: { All for $SubjectID }
*** Assessors: { All for $SubjectID }
 
 
** Non-imaging Assessments: { All for $SubjectID }
 
** Non-imaging Assessments: { All for $SubjectID }
  
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/$SubjectID/experiments?format=xml --cookie JSESSIONID=$sessionID
+
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/$SubjectID/experiments?format=xml --cookie JSESSIONID=$JsessionID
 
  '''parse response''' into list of ExperimentIDs
 
  '''parse response''' into list of ExperimentIDs
 
  for each id in list of ExperimentIDs
 
  for each id in list of ExperimentIDs
 
  {
 
  {
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/scans?format=xml --cookie JSESSIONID=$SessionID
+
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$id/scans?format=xml --cookie JSESSIONID=$JSessionID
 
   '''parse response''' and add to list of ScanIDs
 
   '''parse response''' and add to list of ScanIDs
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/reconstructions?format=xml --cookie JSESSIONID=$SessionID
+
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$id/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 
   '''parse response''' and add to list of ReconstructionIDs
 
   '''parse response''' and add to list of ReconstructionIDs
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/assessors?format=xml --cookie JSESSIONID=$SessionID
+
   '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$idD/assessors?format=xml --cookie JSESSIONID=$JSessionID
 
   '''parse response''' and add to list of AssessorIDs
 
   '''parse response''' and add to list of AssessorIDs
 
  }
 
  }
Line 110: Line 108:
 
* Subject: { All for $ExperimentID }
 
* Subject: { All for $ExperimentID }
 
* Experiments:  $ExperimentID
 
* Experiments:  $ExperimentID
** Imaging Sessions: { All for $ExperimentID }
+
** Scans: { All for $ExperimentID }  
*** Scans: { All for $ExperimentID }  
+
** Reconstructions: { All for $ExperimentID }
*** Reconstructions: { All for $ExperimentID }
+
** Assessors: { All for $ExperimentID }
*** Assessors: { All for $ExperimentID }
 
 
** Non-imaging Assessments: { All for $ExperimentID }
 
** Non-imaging Assessments: { All for $ExperimentID }
 +
 +
'''query:''' curl $XNE_Svr/REST/projects/$ProjectID/experiments/$ExperimentID/subjects?format=xml --cookie JSESSIONID=$JsessionID
 +
'''parse response''' into list of SubjectIDs
 +
for each id in list of SubjectIDs
 +
{
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/scans?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of ScanIDs
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of ReconstructionIDs
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/assessors?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of AssessorIDs
 +
}
 +
update GUI
  
  
Line 120: Line 130:
 
* Subject: $SubjectIDs
 
* Subject: $SubjectIDs
 
* Experiments:  $ExperimentID
 
* Experiments:  $ExperimentID
** Imaging Sessions: { All for $SubjectID && $ExperimentID }
+
** Scans: { All for $SubjectID && $ExperimentID }  
*** Scans: { All for $SubjectID && $ExperimentID }  
+
** Reconstructions: { Focused for $SubjectID && $ExperimentID }
*** Reconstructions: { All for $SubjectID && $ExperimentID }
+
** Assessors: { Focused for $SubjectID && $ExperimentID }
*** Assessors: { All for $SubjectID && $ExperimentID }
+
** Non-imaging Assessments: { Focused for $SubjectID && $ExperimentID }
** Non-imaging Assessments: { All for $SubjectID && $ExperimentID }
 
  
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/scans?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of ScanIDs
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of ReconstructionIDs
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/assessors?format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of AssessorIDs
 +
update GUI
  
''''' 7d. A Session ID is selected; Filters are updated'''''
+
 
 +
''''' 7d. A ScanID is selected; Filters are updated'''''
 
* Subject: $SubjectIDs
 
* Subject: $SubjectIDs
 
* Experiments: $ExperimentID  
 
* Experiments: $ExperimentID  
** Imaging Sessions: $SessionID
+
** Scans: { $ScanID }  
*** Scans: { Focused ScanIDs }  
+
** Reconstructions: { }
*** Reconstructions: { Focused ReconstructionIDs }
+
** Assessors: {  }
*** Assessors: { Focused AssessorIDs }
+
** Non-imaging Assessments: { }
** Non-imaging Assessments: { All for $SubjectID && $ExperimentID && $SessionID }
+
 
 +
 
 +
  '''query:''' curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/scans/$ScanID/format=xml --cookie JSESSIONID=$JSessionID
 +
  '''parse response''' and add to list of ScanIDs
 +
update GUI
  
 
=== 8. Example Query XNAT for All Scans for Selected Experiment ===
 
=== 8. Example Query XNAT for All Scans for Selected Experiment ===

Revision as of 18:28, 4 August 2009

Home < CTSC Slicer XNE

UXP & functionality planning for Slicer's XNE client

Workflow & Implementation approaches

All Workflow Steps:

  • Select XNAT Enterprise server
  • Authentication dialog presented
  • Dialog input is processed
  • XNAT queried for projects
  • response is checked for http error codes
  • xml parsed to get list of projects
  • GUI populated
  • One project selected
  • XNAT queried for subjects in that project
  • response is checked for http error codes
  • xml parsed to get list of subjects
  • GUI populated
  • One subject and filters selected to narrow search
  • User selects "search" for all scans
  • XNAT queried for appropriate scans
  • response is checked for http error codes
  • xml is parsed to get list of scans
  • GUI is populated
  • User selects one scan and "download"
  • Scan is loaded into Slicer

Each step is detailed below.

1. Select XNAT Enterprise Server

This sets the current URI handler to be the XNE_HttpHandler for subsequent REST-based client calls to XNE web services.

2. Authentication Dialog Presented

  • Enter user name and password

3. Process Dialog Input

  • Save the username (XNE_UserName) and password (XNE_Password)
  • Authenticate and create a session:
curl -d POST $XNE_Svr/REST/JSESSION -u $XNE_UserName:$XNE_Password

4. Query XNAT for Projects Available to User

  • XNAT queried for appropriate projects
curl $XNE_Srv/REST/projects?format=xml --cookie JSESSIONID=$sessionID
  • response is checked for http error codes
    • if error is found, report to user
    • else xml is parsed to get list of scans

5. User Selects One Project

6. Query XNAT for Subjects in Selected Project

  • XNAT queried for appropriate subjects
curl $XNE_Svr/REST/projects/$projectID/subjects?format=xml --cookie JSESSIONID=$sessionID
  • response is checked for http error codes
    • if error is found, report to user
    • else xml is parsed to get list of scans

7. User Selects One Subject, Configures Filters to Narrow Search & Selects Search

Presents a search that only requires SubjectID or ExperimentID to be selected in order to populate the list of scans, but each additional selection (corresponding to the basic XNE data model) can be used to focus the search:

7a. Initial Presentation

  • Subject: { All SubjectIDs} (eventually a checkbox for "include shared subjects")
  • Experiments: { All ExperimentIDs } (eventually a checkbox for "include shared experiments")
    • Scans: { }
    • Reconstructions: { }
    • Assessors: { }
    • Non-imaging Assessments: { }
query: curl $XNE_Svr/REST/projects/$ProjectID/subjects?format=xml --cookie JSESSIONID=$JsessionID
parse response into list of SubjectIDs
for each id in list of SubjectIDs
{
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ExperimentIDs
}
update GUI


7b1. Just a Subject ID is selected; Filters are updated

  • Subject: $SubjectID
  • Experiments: { All for $SubjectID }
    • Scans: { Allfor $SubjectID }
    • Reconstructions: { All for $SubjectID }
    • Assessors: { All for $SubjectID }
    • Non-imaging Assessments: { All for $SubjectID }
query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/$SubjectID/experiments?format=xml --cookie JSESSIONID=$JsessionID
parse response into list of ExperimentIDs
for each id in list of ExperimentIDs
{
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$id/scans?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ScanIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$id/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ReconstructionIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$idD/assessors?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of AssessorIDs
}
update GUI

7b2. OR, just an Experiment ID is selected; Filters are updated

  • Subject: { All for $ExperimentID }
  • Experiments: $ExperimentID
    • Scans: { All for $ExperimentID }
    • Reconstructions: { All for $ExperimentID }
    • Assessors: { All for $ExperimentID }
    • Non-imaging Assessments: { All for $ExperimentID }
query: curl $XNE_Svr/REST/projects/$ProjectID/experiments/$ExperimentID/subjects?format=xml --cookie JSESSIONID=$JsessionID
parse response into list of SubjectIDs
for each id in list of SubjectIDs
{
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/scans?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ScanIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ReconstructionIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$id/experiments/$ExperimentID/assessors?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of AssessorIDs
}
update GUI


7c. Both SubjectID && Experiment ID have been selected; Filters are updated

  • Subject: $SubjectIDs
  • Experiments: $ExperimentID
    • Scans: { All for $SubjectID && $ExperimentID }
    • Reconstructions: { Focused for $SubjectID && $ExperimentID }
    • Assessors: { Focused for $SubjectID && $ExperimentID }
    • Non-imaging Assessments: { Focused for $SubjectID && $ExperimentID }
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/scans?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ScanIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/reconstructions?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ReconstructionIDs
 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/assessors?format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of AssessorIDs
update GUI


7d. A ScanID is selected; Filters are updated

  • Subject: $SubjectIDs
  • Experiments: $ExperimentID
    • Scans: { $ScanID }
    • Reconstructions: { }
    • Assessors: { }
    • Non-imaging Assessments: { }


 query: curl $XNE_Svr/REST/projects/$ProjectID/subjects/subjects/$SubjectID/experiments/$ExperimentID/scans/$ScanID/format=xml --cookie JSESSIONID=$JSessionID
 parse response and add to list of ScanIDs
update GUI

8. Example Query XNAT for All Scans for Selected Experiment

  • XNAT queried for appropriate scans
curl $XNE_Svr/REST/projects/$ProjectID/subjects/$SubjectID/experiments/$ExpID/scans?format=xml --cookie JSESSION=$sessionID
  • response is checked for http error codes
    • if error is found, report to user
    • else xml is parsed to get list of scans

9. User Selects One Scan and Clicks Download

curl $XNE_Svr/projects/$ProjectID/subjects/$SubjectID/experiments/$ExpID/scans/$ScanID/resources/DICOM/files

This returns a list of URIs which Slicer uses to populate a vtkMRMLVolumeArchetypeStorageNode:URI and vtkMRMLVolumeArchetypeStorageNode::URIListMembers

10. Scan is Loaded into Slicer

vtkMRMLVolumeArchetypeStorageNode::ReadData( vtkMRMLVolumeArchetypeStorage *node) is called, which calls vtkMRMLStorageNode::StageReadData (*node) to download data using the XNE_HttpHandler.