flywheel.models.mixins
AnalysisMethods
Bases: object
add_analysis(*args, **kwargs)
Add an analysis to this container
AnalysisMixin
Bases: ContainerBase, NoteMethods, TagMethods, FileMethods, InfoMethods, DownloadMethods
download_file(file_name, dest_file, **kwargs)
Download an output file to the given path
update_file_info(file_name, *args, **kwargs)
Update the file's info with the passed in arguments
upload_file(file, **kwargs)
Upload an output file to analysis
upload_output(file, **kwargs)
Upload an output file to analysis
BatchMixin
Bases: ContextBase
Batch mixin that provides cancel shorthand
cancel(**kwargs)
Cancel the batch proposal and any associated jobs
BatchProposalMixin
Bases: ContextBase
Batch mixin that provides run/cancel shorthand
run(**kwargs)
Execute the batch proposal
ContainerBase
Bases: object
local_created property
Get the creation time in the local timezone
local_modified property
Get the modification time in the local timezone
ref()
Make a container reference
reload()
Reload the object from the server, and return the result
update(*args, **kwargs)
Update container using dictionary or kwargs
ContextBase
Bases: object
DownloadMethods
Bases: object
download_tar(dest_file, include_types=None, exclude_types=None, **kwargs)
Download the container as a tarball to dest_file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest_file | str | (required) The destination file on disk | required |
include_types | list | The optional list of types to include in the download (e.g. ['nifti']) | None |
exclude_types | list | The optional list of types to exclude from the download (e.g. ['dicom']) | None |
Returns:
| Type | Description |
|---|---|
| A summary of the download |
download_zip(dest_file, include_types=None, exclude_types=None, **kwargs)
Download the container as a zip archive to dest_file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest_file | str | (required) The destination file on disk | required |
include_types | list | The optional list of types to include in the download (e.g. ['nifti']) | None |
exclude_types | list | The optional list of types to exclude from the download (e.g. ['dicom']) | None |
Returns:
| Type | Description |
|---|---|
| A summary of the download |
FileMethods
Bases: object
delete_file(file_name, **kwargs)
Delete file from the container
delete_file_classification(file_name, classification, **kwargs)
Delete a file's classification fields
delete_file_info(file_name, *args, **kwargs)
Delete the file info fields listed in args
download_file(file_name, dest_file, **kwargs)
Download file to the given path
download_file_zip_member(file_name, member_path, dest_file, **kwargs)
Download file's zip member to the given path
file_ref(name, **kwargs)
Get a reference to the given file
get_file(name, **kwargs)
Get the first file entry with the given name, retrieving the container if necessary
get_file_download_url(file_name, **kwargs)
Get a ticketed download url for the file
get_file_zip_info(file_name, **kwargs)
Get zip member information for this file
get_files(**kwargs)
Get the files collection, retrieving the container if necessary
read_file(file_name, **kwargs)
Read the contents of the file
read_file_zip_member(file_name, member_path, **kwargs)
Read contents of file's zip member
replace_file_classification(file_name, classification, modality=None, **kwargs)
Fully replace a file's modality and classification
replace_file_info(file_name, info, **kwargs)
Fully replace this file's info with the provided value
update_file(file_name, *args, **kwargs)
Update a file's type and/or modality
update_file_classification(file_name, classification, **kwargs)
Update a file's classification
update_file_info(file_name, *args, **kwargs)
Update the file's info with the passed in arguments
upload_file(file, **kwargs)
Upload a file to a container
FileMixin
Bases: ContainerBase
local_replaced property
Get the replaced timestamp in local time
add_tag(tag, **kwargs)
Add the given tag to the file
add_tags(tags, **kwargs)
Add the tags to the tags list on the file
delete_classification(classification, **kwargs)
Delete a file's classification fields
delete_info(*args, **kwargs)
Delete the file info fields listed in args
delete_tag(tag, **kwargs)
Delete tag from file
download(dest_file, **kwargs)
Download file to the given path
download_zip_member(member_path, dest_file, **kwargs)
Download file's zip member to the given path
get_zip_info(**kwargs)
Get zip member information for this file
read(**kwargs)
Read the contents of the file
read_zip_member(member_path, **kwargs)
Read contents of file's zip member
ref()
Make a file reference
reload(**kwargs)
Reload the file.
rename_tag(tag, new_tag, **kwargs)
Rename tag on file
replace_classification(classification, modality=None, **kwargs)
Fully replace a file's modality and classification
replace_info(info, **kwargs)
Fully replace this file's info with the provided value
set_tags(tags, **kwargs)
Set the tags list on the file
update(*args, **kwargs)
Update a file's type and/or modality
update_classification(classification, **kwargs)
Update a file's classification
update_info(*args, **kwargs)
Update the file's info with the passed in arguments
url(**kwargs)
Get a ticketed download url for the file
GroupMixin
Bases: ContainerBase, TagMethods, PermissionMethods
add_permission_template(permission, **kwargs)
Add a permission template for a group
add_project(*args, **kwargs)
Add a project to this group
delete_permission_template(user_id, **kwargs)
Delete a user's permission template from a group
get_permission_template(user_id, **kwargs)
Get a user's permission template for a group
update_permission_template(user_id, permission, **kwargs)
Update a user's permission template for a group
InfoMethods
Bases: object
delete_info(*args)
Delete the info fields listed in args
replace_info(info)
Fully replace this object's info with the provided value
update_info(*args, **kwargs)
Update the info with the passed in arguments
JobMixin
Bases: ContainerBase
change_state(new_state, **kwargs)
Change the state of the job to new_state
get_logs(**kwargs)
Get the job log entries
print_logs(file=None, **kwargs)
Print logs to file (or stdout, if file is not specified)
update_priority(priority, **kwargs)
Update priority of jobs
NoteMethods
Bases: object
add_note(message, **kwargs)
Add the given note to the object
delete_note(note_id, **kwargs)
Delete the given note on the object
PermissionMethods
Bases: object
add_permission(permission, **kwargs)
Add a permission to a container
delete_permission(user_id, **kwargs)
Delete a user's permission from container
get_permission(user_id, **kwargs)
Get a user's permission from container
update_permission(user_id, permission, **kwargs)
Update a user's permission on container
ProjectMixin
Bases: ContainerBase, TagMethods, NoteMethods, PermissionMethods, FileMethods, InfoMethods, DownloadMethods, AnalysisMethods
add_session(*args, **kwargs)
Add a session to this project
add_subject(*args, **kwargs)
Add a subject to this project
ResolverOutputMixin
Bases: object
SessionMixin
Bases: ContainerBase, TagMethods, NoteMethods, FileMethods, InfoMethods, TimestampMethods, DownloadMethods, AnalysisMethods
add_acquisition(*args, **kwargs)
Add a acquisition to this session
SubjectMixin
Bases: ContainerBase, TagMethods, NoteMethods, FileMethods, InfoMethods, AnalysisMethods
add_session(*args, **kwargs)
Add a session to this subject
TagMethods
Bases: object
add_tag(tag, **kwargs)
Add the given tag to the object
delete_tag(tag, **kwargs)
Delete tag from object
rename_tag(tag, new_tag, **kwargs)
Rename tag on object
TimestampMethods
Bases: object
local_timestamp property
Get the timestamp in the local timezone
original_timestamp property
Get the timestamp in the original timezone