copyxnat.xnat_backend.simple_xnat module¶
SimpleXnat wrappers for the XNAT REST API
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatAssessor(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithInOutResourcesWrapper around a pyxnat assessor interface
- label_keys = ['label']¶
- optional = True¶
- parent_container_list = 'assessor_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'assessors'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatBase[source]¶
Bases:
objectBase class for an item in the XNAT REST hierarchy
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatExperiment(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithResourcesWrapper around an XNAT experiment interface
- label_keys = ['label']¶
- optional = False¶
- parent_container_list = 'experiment_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'experiments'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatFile(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWrapper around an XNAT file interface
- create_on_server(local_file, create_params, overwrite, reporter)[source]¶
Create this item on the XNAT server if it does not already exist
- label_keys = ['Name']¶
- optional = False¶
- parent_container_list = 'file_list'¶
- rest_id_keys = ['Name']¶
- rest_type = 'files'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatInResource(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatResourceBaseWrapper around an XNAT in-resource
- optional = False¶
- parent_container_list = 'in_resource_list'¶
- rest_type = 'in/resources'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatItem(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatBaseAbstraction of wrappers around XNAT REST API interfaces
- classmethod create(parent, label)[source]¶
Create a new child item of this class type from given parent
- create_on_server(local_file, create_params, overwrite, reporter)[source]¶
Create this item on the XNAT server if it does not already exist
- classmethod get_existing(parent, label, metadata)[source]¶
Create a new child item of this class type from given parent
- abstract property label_keys¶
Name of the dictionary key in the item’s metadata dict which will be used to match items between servers. In most cases label is appropriate if it exists for this item’s metadata
- abstract property optional¶
True if this type is not guaranteed to exist in its parent’s schema. For example, some experiment types might not include scans, so querying for scans might return a 404 error. If this property is set to True, then a 404 error will be returned as en empty array.
For example, experiments derive from type subjectAssessorData. This does not itself have scans, but many experiments derive from the subtype imageSessionData which does include scans. But another experiment type derived from subjectAssessorData might not have scans. This flag allows us to process experiments with and without scans without having to parse the schema.
- abstract property parent_container_list¶
Name of the parent property which contains the LazyList object which can be queried to get the metadata for this item.
- read_uri()[source]¶
Return URI of this XNAT item relative to the XNAT REST interface as used for read operations
- abstract property rest_id_keys¶
List of the dictionary keys in the item’s metadata dict which can be used to as part of the REST URI to fetch a resource or metadata. The first key in the list which has a non-empty value in the dict will be used. In most cases ID is appropriate, but does not exist for all items. label can often be used if it exists but may be empty for some types of resource collections.
- abstract property rest_type¶
Return the type specifier used in the REST URL
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithInOutResources(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWrapper around an XNAT interface that can contain resources
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithResources(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWrapper around a XNAT REST API interface that can contain resources
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatOutResource(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatResourceBaseWrapper around an XNAT out-resource
- optional = False¶
- parent_container_list = 'out_resource_list'¶
- rest_type = 'out/resources'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatProject(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithResourcesWrapper around an XNAT project interface
- label_keys = ['ID']¶
- optional = False¶
- parent_container_list = 'cached_project_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'projects'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatReconstruction(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithInOutResourcesWrapper around an XNAT reconstruction
- label_keys = ['ID']¶
- optional = True¶
- parent_container_list = 'reconstruction_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'reconstructions'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatResource(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatResourceBaseWrapper around an XNAT resource interface
- optional = False¶
- parent_container_list = 'resource_list'¶
- rest_type = 'resources'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatResourceBase(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWrapper around an XNAT resource interface
- create_on_server(local_file, create_params, overwrite, reporter)[source]¶
Create this item on the XNAT server if it does not already exist
- label_keys = ['label', 'xnat_abstractresource_id']¶
- rest_id_keys = ['label', 'xnat_abstractresource_id']¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatScan(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithResourcesWrapper around an XNAT interface for items which can contain resources
- label_keys = ['ID']¶
- optional = True¶
- parent_container_list = 'scan_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'scans'¶
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatServer(params, read_only)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatBaseInterface to XNAT REST API
- class copyxnat.xnat_backend.simple_xnat.SimpleXnatSubject(parent, label, metadata)[source]¶
Bases:
copyxnat.xnat_backend.simple_xnat.SimpleXnatItemWithResourcesWrapper around an XNAT subject interface
- label_keys = ['label']¶
- optional = False¶
- parent_container_list = 'subject_list'¶
- rest_id_keys = ['ID']¶
- rest_type = 'subjects'¶