/data/services/import

HTTP CommandRequest & Response format
GET: REQ 
GET: RESP 
PUT: REQ 
PUT: RESP 
POST: REQFILE
?inbody
POST: RESP 
DELETE: REQ 
DELETE: RESP 

Details

Introduced with XNAT 1.5, the import service is a customizable upload implementation for importing data into XNAT. XNAT comes with several pre-configured import implementations, but can be configured via java to meet any need.

The import is built to receive a zip, tar.gz, etc and place it into the prearchive or archive space. It has also been modified to import files from the user's cache space, which would have been previously uploaded.

Parameters:

(All parameters are optional, though the 'dest' is highly encouraged).
overwrite: defaults to none

  • none: Do not overwrite existing xml or files
  • append: Add content to existing xml & file system, but do not overwrite existing files
  • delete: Upload new data, and overwrite any existing files. 

quarantine: defaults to false

  • false: follow project settings for whether new/modified archive content should go into quarantine
  • true: override project settings and place new/modified archive content in quarantine.


triggerPipelines: defaults to true

  • true: run the AutoRun pipeline for any archived sessions which are modified/created by this import
  • false: Do not run the AutoRun at this time


src: Only used when attempting to import a previously uploaded file. You can specify multiple src attributes or seperate them with commas.

  • /user/cache/resources/X/files/X.zip


dest: Specifies intended destination. If it is empty, it will review the uploaded content and attempt to put it in the right place (or leave it in the prearchive Unassigned).

  • /prearchive
    • It will try to determine the proper project from the DICOM/ECAT headers.
  • /prearchive/projects/PROJECT
  • /prearchive/projects/PROJECT/timestamp
  • /prearchive/projects/PROJECT/timestamp/session
    • Importing to this url would allow you to merge additional content with previously uploaded content.
  • /archive
    • It will try to determine the proper project from the DICOM/ECAT headers.
  • /archive/projects/PROJECT
  • /archive/projects/PROJECT/subjects/SUBJECT
  • /archive/projects/PROJECT/subjects/SUBJECT/experiments/LABEL
    • Importing to this url would allow you to merge content with previously archived data.


import-handler: defaults to standard import logic

  • free-form text: client can specify a key which the server maps to a different implementation of the import logic.

http-session-listener: used by the web based zip uploader

  •  free-form text: which should uniquely identify this upload process. If this is used, an http-session variable will be created using this text as the attribute ID, and will contain process/status information.

inbody: Used to tell the server that the body of the message is the actual file

  • This shouldn't be necessary if all upload tools set the Content-Type header appropriately.  But, many do not.  If your upload is failing and you can't figure out why, try setting this to true

project

  • ID of project: For use when not using dest attribute.

Using the import-handler attribute, you can specify a specific implementation of the import logic.

  • import-handler=SI
    • (default) standard session importer: Used to import individual DICOM or ECAT files or zips of DICOM or ECAT files.  Most of the parameters above only work with this importer
  •  import-handler=gradual-DICOM
    • same implementation as XNAT's integrated DICOM receiver  Accepts individual DICOM files and follows the DICOM receiver mapping/archive logic
  • import-handler=DICOM-zip
    • similar to the gradual-DICOM but accepts zipped collections of DICOM files  This is used by the Upload Applet
  • import-handler=XAR
    • used to upload XAR files (zip files which include the session xml and the associated files)

$label.name