copyxnat.xnat_backend.pyxnat_server module

Wrappers for communicating between copyxnat items and pyXNAT backend items

class copyxnat.xnat_backend.pyxnat_server.PyXnatAssessor(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithInOutResources

Wrapper around a pyxnat assessor interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatExperiment(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithResources

Wrapper around a pyxnat experiment interface

assessors()[source]

Return array of PyXnatAssessor wrappers for this experiment

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

reconstructions()[source]

Return array of PyXnatReconstruction wrappers for this experiment

scans()[source]

Return array of PyXnatScan wrappers for this experiment

class copyxnat.xnat_backend.pyxnat_server.PyXnatFile(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItem

Wrapper around a pyxnat file interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

create_on_server(local_file, create_params, overwrite, reporter)[source]

Create this item on the XNAT server if it does not already exist

download_file(save_dir, label)[source]

Get file from server and save to disk

file_attributes()[source]

Return dict of file attributes

class copyxnat.xnat_backend.pyxnat_server.PyXnatInResource(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatResourceBase

Wrapper around a pyxnat in resource interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatItem(interface, label=None)[source]

Bases: object

Abstraction of wrappers around pyXnat interfaces

classmethod create(parent, label)[source]

Create a new child item of this class type from given parent

abstract classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

create_on_server(local_file, create_params, overwrite, reporter)[source]

Create this item on the XNAT server if it does not already exist

datatype()[source]

Return the XNAT datatype of this item

exists()[source]

Return True if the item already exists on the server

fetch_interface()[source]

Return the pyxnat interface to this item

get_attribute(name)[source]

Return the specified attribute from this item

get_id()[source]

Return the XNAT ID of this item

get_label()[source]

Return the XNAT label of this item, or ID if the label is empty

get_xml_string()[source]

Return XML representation of this XNAT item

set_attribute(name, value)[source]

Return the specified attribute from this item

class copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithInOutResources(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItem

Wrapper around a pyxnat interface that can contain resources

abstract classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

in_resources()[source]

Return item’s in resources as an array of PyXnatResource wrappers

out_resources()[source]

Return item’s out resources as an array of PyXnatResource wrappers

class copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithResources(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItem

Wrapper around a pyxnat interface that can contain resources

abstract classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

resources()[source]

Return item’s resources as an array of PyXnatResource wrappers

class copyxnat.xnat_backend.pyxnat_server.PyXnatOutResource(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatResourceBase

Wrapper around a pyxnat out resource interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatProject(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithResources

Wrapper around a pyxnat project interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

subjects()[source]

Return array of PyXnatSubject wrappers for this project

class copyxnat.xnat_backend.pyxnat_server.PyXnatReconstruction(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithInOutResources

Wrapper around a pyxnat reconstruction interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatResource(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatResourceBase

Wrapper around a pyxnat resource interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatResourceBase(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItem

Wrapper around a pyxnat resource interface

abstract classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

create_on_server(local_file, create_params, overwrite, reporter)[source]

Create this item on the XNAT server if it does not already exist

download_zip_file(save_dir)[source]

Get zip file from server and save to disk

files()[source]

Return item’s files as an array of PyXnatFile wrappers

resource_attributes()[source]

Return dict of resource attributes

class copyxnat.xnat_backend.pyxnat_server.PyXnatScan(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithResources

Wrapper around a pyxnat scan interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

class copyxnat.xnat_backend.pyxnat_server.PyXnatServer(params)[source]

Bases: object

Wrapper around pyXNAT server interface

datatypes()[source]

Return datatypes on this server

experiment_list(project)[source]

Return list of experiments in this project

fetch_interface()[source]

Return the pyxnat interface to this server

logout()[source]

Disconnect from server

num_experiments(project)[source]

Return number of experiments in this project

project(label)[source]

Return PyXnatProject project

project_list()[source]

Return array of project ids

project_name_metadata()[source]

Return list of dictionaries containing project name metadata

projects()[source]

Return array of PyXnatProject projects

request(uri, method)[source]

Execute a REST call on the server

request_json_property(uri)[source]

Execute a REST call on the server and return string

request_string(uri)[source]

Execute a REST call on the server and return string

class copyxnat.xnat_backend.pyxnat_server.PyXnatSubject(interface, label=None)[source]

Bases: copyxnat.xnat_backend.pyxnat_server.PyXnatItemWithResources

Wrapper around a pyxnat subject interface

classmethod create_interface(parent, label)[source]

Create a pyXnat child interface from the given pyXnat parent

experiments()[source]

Return array of PyXnatExperiment wrappers for this subject