siemens_to_ismrmrd_client

siemens_to_ismrmrd client.

class mr_utils.load_data.siemens_to_ismrmrd_client.FastTransport(sock)[source]
class mr_utils.load_data.siemens_to_ismrmrd_client.TqdmWrap(iterable=None, desc=None, total=None, leave=True, file=None, ncols=None, mininterval=0.1, maxinterval=10.0, miniters=None, ascii=None, disable=False, unit='it', unit_scale=False, dynamic_ncols=False, smoothing=0.3, bar_format=None, initial=0, position=None, postfix=None, unit_divisor=1000, write_bytes=None, gui=False, **kwargs)[source]
viewBar(a, b)[source]

Monitor progress of sftp transfers

mr_utils.load_data.siemens_to_ismrmrd_client.s2i_client(filename, put_file=True, get_file=True, cleanup_raw=True, cleanup_processed=True, remote_dir='/tmp', host=None, port=22, username=None, ssh_key=None, password=None, debug_level=20)[source]

Runs siemens_to_ismrmrd on a remote computer.

Main idea: allow users to use siemens_to_ismrmrd even if they don’t have it installed locally. They will, however, require SSH access to computer that does have it installed.

Client puts file on server using SFTP, runs siemens_to_ismrmrd over SSH, and gets the file back using SFTP. Username, password, hostname, and port is retrieved from the active profile in profiles.config. Default port is 22. If no password is found, the RSA SSH key will be used from either the specified directory in profiles.config or, if empty, use ‘~/.ssh/id_rsa’.

Parameters:
  • filename (str) – Raw data (.dat) file on the local machine (if put_file is True) or on the remote machine (if put_file is False).
  • put_file (bool, optional) – Whether or not to copy the raw data file from local to remote.
  • get_file (bool, optional) – Whether or not to copy the processed file from machine to local.
  • cleanup_raw (bool, optional) – Whether or not to delete raw data on remote.
  • cleanup_processed (bool, optional) – Whether or not to delete processed data on remote.
  • remote_dir (str, optional) – Working directory on remote (default in /tmp).
  • host (str, optional) – hostname of remote machine.
  • port (int, optional) – Port of remote machine to connect to.
  • username (str, optional) – Username to use for SSH/SFTP connections.
  • ssh_key (str, optional) – RSA private key file to use for SSH/SFTP connections.
  • password (str, optional) – Password to use fr SSH/SFTP connections (stored in plaintext).
  • debug_level (logging_level, optional) – Level of verbosity; see python logging module.
Returns:

dset – Result of siemens_to_ismrmrd

Return type:

ismrmrd.Dataset