def _make_landmark_transform_cmd(self, landmarks_in, landmarks_out, transform_path): st.check_exists(landmarks_in, "Landmarks") dim_str = " -dim %d" % (self.dim) cmd = self.bin_path + "ACTransformLandmarks" + exe_extension st.check_exists(cmd, "Executable") cmd = cmd + " -in " + landmarks_in + " -out " + landmarks_out + " -transform " + transform_path + dim_str return cmd
def _make_random_transforms_cmd(self, in_path, out_path, count, param=None): if param is None: param = self.get_random_transforms_param_defaults() st.check_exists(in_path, "Input") dim_str = " -dim %d" % (self.dim) count_str = " -count %d" % (count) cmd = self.bin_path + "ACRandomTransforms" + exe_extension cmd = cmd + " -in " + in_path + " -out " + out_path + dim_str + count_str + st.param_dict_to_string( param) return cmd
def _make_register_cmd(self, ref_im_path, flo_im_path, out_path, is_rigid, param=None): if param is None: print("Using default param.") param = self.get_register_param_defaults() st.check_exists(ref_im_path, "Reference") st.check_exists(ref_im_path, "Floating") if self.dim == 2: three_d_str = " -3d 0" else: three_d_str = " -3d 1" if is_rigid: rigid_str = " -rigid 1" else: rigid_str = " -rigid 0" cmd = self.bin_path + "ACRegister" + exe_extension st.check_exists(cmd, "Executable") cmd = cmd + " -in1 " + ref_im_path + " -in2 " + flo_im_path + " -out " + out_path + rigid_str + three_d_str + st.param_dict_to_string( param) return cmd
def _make_label_overlap_cmd(self, ref_im_path, transformed_im_path, out_path, param=None): if param is None: param = self.get_label_overlap_param_defaults() st.check_exists(ref_im_path, "Reference") st.check_exists(transformed_im_path, "Transformed") dim_str = " -dim %d" % (self.dim) cmd = self.bin_path + "ACLabelOverlap" + exe_extension st.check_exists(cmd, "Executable") cmd = cmd + " -in1 " + ref_im_path + " -in2 " + transformed_im_path + " -out " + out_path + dim_str + st.param_dict_to_string( param) return cmd
def _make_transform_cmd(self, ref_im_path, flo_im_path, out_path, transform_path, param=None): if param is None: param = self.get_transform_param_defaults() st.check_exists(ref_im_path, "Reference") st.check_exists(flo_im_path, "Floating") dim_str = " -dim %d" % (self.dim) cmd = self.bin_path + "ACTransform" + exe_extension st.check_exists(cmd, "Executable") cmd = cmd + " -ref " + ref_im_path + " -in " + flo_im_path + " -out " + out_path + " -transform " + transform_path + dim_str + st.param_dict_to_string( param) return cmd