OpenMind Interaction API
RegistrationGraph.write_sbatch_graph — Functionwrite_sbatch_graph(
edges, param_path_fixed::Dict, param_path_moving::Dict, param::Dict;
clear_cmd_dir::Bool=true,
cpu_per_task_key::String="cpu_per_task",
memory_key::String="memory",
duration_key::String="duration",
duration_julia_key::String="duration_julia",
job_name_key::String="job_name",
fixed_channel_key::String="ch_marker",
moving_channel_key::String="ch_marker",
head_dir_key::String="path_head_pos",
om_data_key::String="path_om_data",
om_scripts_key::String="path_om_scripts",
nrrd_dir_key::String="path_dir_nrrd_filt",
nrrd_om_dir_key::String="path_om_nrrd_filt",
mask_dir_key::String="path_dir_mask",
mask_om_dir_key::String="path_om_mask",
reg_dir_key::String="path_dir_reg",
reg_om_dir_key::String="path_om_reg",
path_head_rotate_key::String="path_head_rotate",
parameter_files_key::String="parameter_files",
cmd_dir_key::String="path_dir_cmd",
cmd_om_key::String="path_om_cmd",
cmd_array_dir_key::String="path_dir_cmd_array",
cmd_array_om_key::String="path_om_cmd_array"
)Syncs data from local computer to a remote server and creates command files for elastix on that server.
WARNING: This program can permanently delete data if run with incorrect arguments.
Arguments
edges: List of registration problems to performparam_path_fixed::Dict: Dictionary containing paths for the fixed images including:get_basename: Function that maps channel and time point to NRRD filenamepath_dir_cmd: Path to elastix command directorypath_om_cmd: Path to elastix command directory on the serverpath_om_scripts: Path to directory to store scripts on the serverpath_dir_cmd_array: Path to elastix array command directorypath_om_cmd_array: Path to elastix array command directory on the serverpath_om_log: Path to log file on serverpath_om_tmp: Path to temporary directory on serverpath_om_env: Path to script to set environment variablespath_run_elastix: Path to script that runs elastix given command on the serverpath_elastix: Path to elastix executable on the servername_head_rotate_logfile: Name of head rotate log files
param_path_moving::Dict: Dictionary containing paths for the moving images including the same keys as with the fixed dictionary.param::Dict: Dictionary containing parameters including:email: Email to inform user of task termination. Ifnothing, no emails will be sentuse_sbatch: Usesbatch, rather than directly running code on the server. This should always be set totrueon OpenMindserver_dtn: Address of server to transfer data touser: Username on serverarray_size: Size ofsbatcharray to usepartition: Priority of jobs onsbatch
Optional keyword arguments
clear_cmd_dir::Bool: Whether to clear the elastix command directory, useful if you are re-running registrationscpu_per_task_key::String: Key inparamto CPU cores per elastix task. Defaultcpu_per_taskmemory_key::String: Key inparamto memory per elastix task. Defaultmemoryduration_key::String: Key inparamto the duration of each elastix task. Defaultdurationduration_julia_key::String: Key inparamto the duration of the Julia script that runs all elastix task. Defaultduration_juliajob_name_key::String: Key inparamto the name of the elastix tasks. Defaultjob_namefixed_channel_key::String: Key inparamto the fixed channel. Defaultch_markermoving_channel_key::String: Key inparamto the moving channel. Defaultch_markerhead_dir_key::String: Key inparam_path_*to the head position of the worm. Defaultpath_head_posom_data_key::String: Key inparam_path_*to the path to sync the data on the server. Defaultpath_om_dataom_scripts_key::String: Key inparam_path_*to the path to sync the scripts on the server. Default `pathomscriptsnrrd_dir_key::String: Key inparam_path_*to the path to the NRRD files. Defaultpath_dir_nrrd_filtnrrd_om_dir_key::String: Key inparam_path_*to the path to the NRRD files on the server. Defaultpath_om_nrrd_filtmask_dir_key::String: Key inparam_path_*to the mask path. Defaultpath_dir_maskmask_om_dir_key::String: Key inparam_path_*to the mask path on the server. Defaultpath_om_maskreg_dir_key::String: Key inparam_path_*to the registration output directory. Defaultpath_dir_regreg_om_dir_key::String: Key inparam_path_*to the registration output directory on the server.path_om_regpath_head_rotate_key::String: Key inparam_path_fixedto the path on the server to the head rotation python file. Defaultpath_head_rotateparameter_files_key::String: Key inparam_path_fixedto the path on the server to the elastix parameter files. Defaultparameter_filescmd_dir_key::String: Key inparam_path_fixedto the local path to store theelastixscripts. Defaultpath_dir_cmdcmd_om_key::String: Key inparam_path_fixedto the path on the server to store theelastixscripts. Defaultpath_om_cmdcmd_array_dir_key::String: Key inparam_path_fixedto the local path to store theelastixarray scripts. Defaultpath_dir_cmd_arraycmd_array_om_key::String: Key inparam_path_fixedto the path on the server to store theelastixarray scripts. Defaultpath_om_cmd_array
RegistrationGraph.run_elastix_openmind — Functionrun_elastix_openmind(param_path::Dict, param::Dict; extra_cmd_paths=[])Runs elastix on OpenMind. Requires julia to be installed under the relevant username and activated in the default ssh shell. Note that you cannot have multiple instances of this command running simultaneously with the same temp_dir. Returns the jobid of the Julia script-submission job.
Arguments
param_path::Dict: Dictionary of parameter paths including:path_om_tmp: Path to temporary directory on OpenMind.path_om_cmd: Path to elastix command directory on OpenMind.path_om_cmd_array: Path to elastix array command directory on OpenMind.
param::Dict: Dictionary of parameter settings including:user: OpenMind usernameserver: Login node address on OpenMindpartition: Partition to run elastix using (eguse-everything)
extra_cmd_paths(optional, default[]): Extra paths to script files to run
RegistrationGraph.get_lock — Functionget_lock(param_path::Dict, param::Dict; lock_key::String="path_dir_lock")Get a lock in param_path[lock_key]. Wait a minimum of param["lock_wait"] between successive lock checks.
RegistrationGraph.release_lock — Functionrelease_lock(param_path::Dict, param::Dict; lock_key::String="path_dir_lock")Release a lock in param_path[lock_key].
RegistrationGraph.wait_for_elastix — Functionwait_for_elastix(param::Dict)This function stalls until all the user's jobs on OpenMind are completed.
Arguments
param::Dict: Parameter dictionary including:user: Username on OpenMindserver: Login node address on OpenMindelx_wait_delay: Time to wait between checking whether elastix is done, in seconds
wait_for_elastix(param::Dict, jobid::Int)This function stalls until the specified job is completed.
Arguments
param::Dict: Parameter dictionary including:user: Username on OpenMindserver: Login node address on OpenMindelx_wait_delay: Time to wait between checking whether elastix is done, in seconds
jobid::Int: Sbatch job ID of the Julia script-submission script
RegistrationGraph.get_squeue_status — Functionget_squeue_status(param::Dict)Gets the number of running and pending squeue commands from the given user.
Arguments
param::Dict: Parameter dictionary including:user: Username on OpenMindserver: Login node address on OpenMind
get_squeue_status(param::Dict, jobid::Int)Gets the number of running and pending squeue commands from the given user.
Arguments
param::Dict: Parameter dictionary including:user: Username on OpenMindserver: Login node address on OpenMind
jobid::Int: Sbatch job ID of the Julia script-submission script
RegistrationGraph.sync_registered_data — Functionsync_registered_data(param_path::Dict, param::Dict; reg_dir_key::String="path_dir_reg", reg_om_dir_key::String="path_om_reg")Deletes unnecessary files, then syncs registration data from a remote compute server back to the local computer.
Arguments
param_path::Dict: Dictionary of pathsparam::Dict: Dictionary of parameters including:user: Username on OpenMindserver_dtn: Data transfer node address on OpenMind
reg_dir_key::String(optional, defaultpath_dir_reg): Key inparam_pathto the path to the registration output directoryreg_om_dir_key::String(optional, defaultpath_om_reg): Key inparam_pathto the path to the registration output directory on the server
RegistrationGraph.fix_param_paths — Functionfix_param_paths(problems, param_path::Dict, param::Dict; reg_dir_key::String="path_dir_reg", n_resolution_key::String="reg_n_resolution")Updates parameter paths in transform parameter files, to allow transformix to be run on them. Returns a dictionary of errors per problem and resolution.
Arguments
problems: Registration problems to updateparam_path::Dict: Dictionary of paths including:path_root_process: Path to datapath_om_data: Path to data on server
param::Dict: Dictionary of parametersreg_dir_key::String(optional, defaultpath_dir_reg): Key inparam_pathto the path to the registration output directoryn_resolution_key::String(optional, defaultreg_n_resolution): Key inparamto array of number of registrations with each parameter file