Class: Scan

Scan(jsXnat)

Scan related API

Constructor

new Scan(jsXnat)

Constructor

.

Constructor

Parameters:
Name Type Description
jsXnat JsXnat
Source:

Members

ScanXmlPathShortcuts

Scan Data REST XML Path Shortcuts

.

Scan Data REST XML Path Shortcuts

Source:

Methods

createFolder(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, resourceLabel, format, tags, contents, cb)

Create A New Project Resource Folder

.

Create A New Project Resource Folder

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

resourceLabel string

resource label (folder name)

format string

Optional. Specify a string format descriptor for this resource folder.

tags string | array

Optional. Specify a comma-separated list of tags for this resource folder.

contents string

Optional. Specify a string description of the resource folder's content.

cb function

optional callback function

Source:
Returns:

none

createScan(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, xsiType, json, cb)

Add Scan To An Image Session

.

Add Scan To An Image Session

Parameters:
Name Type Description
projectId object

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

xsiType string

scan id

json object

refer to ScanXmlPathShortcuts or XML Path Shortcuts: https://wiki.xnat.org/display/XAPI/Subject+Data+REST+XML+Path+Shortcuts

cb function

optional callback function

Source:
Returns:

none

deleteFile(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, resourceIdOrLabel, filename, cb)

Delete A Project Resource File

.

Delete A Project Resource File

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

resourceIdOrLabel string

resource id or label (folder name)

filename string

filename

cb function

optional callback function

Source:
Returns:

none

deleteFolder(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, resourceIdOrLabel, safe, cb)

Delete A Project Resource Folder

.

Delete A Project Resource Folder

Parameters:
Name Type Default Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

resourceIdOrLabel string

resource id or label (folder name)

safe boolean false

Optional. if throw errors if files exists in the resource folder

cb function

optional callback function

Source:
Returns:

none

deleteScan(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, removeFiles, cb)

Modify Scan Metadata

.

Modify Scan Metadata

Parameters:
Name Type Default Description
projectId object

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

removeFiles boolean false

Optional query param. Defaults to "FALSE", which will leave files in the file system after deleting the experiment record in Postgres. When this param is set to "TRUE", those files are permanently deleted.

cb function

optional callback function

Source:
Returns:

none

getDicomDump(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, fields, format, cb)

returns dicom header dump for a scan

.

returns dicom header dump for a scan

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

fields array | string

Optional. tag name or tag number to display

format string

Optional. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON

cb function

optional callback function

Source:
Returns:

a list of matched entities

getFile(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, resourceIdOrLabel, filename, cb)

Get A Listing Of Resource Files Stored With A Project

.

Get A Listing Of Resource Files Stored With A Project

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

resourceIdOrLabel string

resource id or label (folder name)

filename string

filename

cb function

optional callback function

Source:

getFiles(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, sortBy, format, cb)

Get A Listing Of Resource Files Stored With A Project

.

Get A Listing Of Resource Files Stored With A Project

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

sortBy array | string

Optional. Sort the returned results by one or more parameters in the Result array. Multiple parameters can be provided

format string

Optional. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON

cb function

optional callback function

Source:

getFolders(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, sortBy, format, cb)

Get A Listing Of Resource Folders Stored With A Subject

.

Get A Listing Of Resource Folders Stored With A Subject

Parameters:
Name Type Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

sortBy array | string

Optional. Sort the returned results by one or more parameters in the Result array. Multiple parameters can be provided

format string

Optional. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON

cb function

optional callback function

Source:

getScanResources(options, scanId, format, cb)

Get A Listing Of A Single Scan's Resources

.

Get A Listing Of A Single Scan's Resources

Parameters:
Name Type Description
options object

experient identification options

Properties
Name Type Description
projectId string

Optional. project id

subjectIdOrLabel string

Optional. subject id or label

experimentId string

Optional. experiment id

experimentLabel string

Optional. experiment label

scanId string

scan id

format string

Optional. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON

cb function

optional callback function

Source:
Returns:

none

getScans(options, format, cb)

Get A Listing Of Scans From An Image Session

.

Get A Listing Of Scans From An Image Session

Parameters:
Name Type Description
options object

experient identification options

Properties
Name Type Description
projectId string

Optional. project id

subjectIdOrLabel string

Optional. subject id or label

experimentId string

Optional. experiment id

experimentLabel string

Optional. experiment label

format string

Optional. Set the format of the response. Format value can be json, html, xml, or csv. If not specified, default is JSON

cb function

optional callback function

Source:
Returns:

none

updateScan(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, xsiType, json, cb)

Modify Scan Metadata

.

Modify Scan Metadata

Parameters:
Name Type Description
projectId object

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

xsiType string

xsiType e.g., xnat:mrScanData

json object

refer to ScanXmlPathShortcuts or XML Path Shortcuts: https://wiki.xnat.org/display/XAPI/Subject+Data+REST+XML+Path+Shortcuts

cb function

optional callback function

Source:
Returns:

none

uploadFile(projectId, subjectIdOrLabel, experimentIdOrLabel, scanId, resourceIdOrLabel, filename, file, overwrite, cb)

Upload A New Project Resource File

.

Upload A New Project Resource File

Parameters:
Name Type Default Description
projectId string

project id

subjectIdOrLabel string

subject id or label

experimentIdOrLabel string

experiment id or label

scanId string

scan id

resourceIdOrLabel string

resource id or label (folder name)

filename string

filename

file Buffer

file buffer (need to check if this is compatilable from browser)

overwrite boolean false

Optional. overwrite the file if the file that has the same filename already exists in the same location

cb function

optional callback function

Source:
Returns:

none