diff --git a/install.sh b/install.sh index e81d988..20c48dd 100644 --- a/install.sh +++ b/install.sh @@ -44,5 +44,8 @@ csv_labels=$template_dir/DSURQE_40micron_R_mapping.csv python $RABIES/gen_masks.py $DSURQE_100micron_labels $csv_labels $template_dir/DSURQE_100micron # install twolevel_ants_dbm -git clone https://github.com/CobraLab/twolevel_ants_dbm $RABIES/twolevel_ants_dbm && \ +git clone https://github.com/CoBrALab/twolevel_ants_dbm.git $RABIES/twolevel_ants_dbm +cd twolevel_ants_dbm +git checkout bde563f3ee017eb7f374b72e8599f2102a69c1da +cd .. echo 'export PATH=$RABIES/twolevel_ants_dbm:$PATH' >> $HOME/.bashrc diff --git a/rabies/preprocess_bold_pkg/resampling.py b/rabies/preprocess_bold_pkg/resampling.py index 4d48de7..8592abb 100644 --- a/rabies/preprocess_bold_pkg/resampling.py +++ b/rabies/preprocess_bold_pkg/resampling.py @@ -26,9 +26,9 @@ def init_bold_preproc_trans_wf(resampling_dim, name='bold_preproc_trans_wf'): bold_transform.inputs.resampling_dim = resampling_dim bold_transform.inputs.data_type = os.environ["rabies_data_type"] - merge = pe.Node(Merge(), name='merge', mem_gb=5) + merge = pe.Node(Merge(), name='merge', mem_gb=3) merge.inputs.data_type = os.environ["rabies_data_type"] - merge.plugin_args = {'qsub_args': '-pe smp %s' % (str(4*int(os.environ["min_proc"]))), 'overwrite': True} + merge.plugin_args = {'qsub_args': '-pe smp %s' % (str(3*int(os.environ["min_proc"]))), 'overwrite': True} # Generate a new BOLD reference bold_reference_wf = init_bold_reference_wf() @@ -72,9 +72,9 @@ def init_bold_commonspace_trans_wf(resampling_dim, name='bold_commonspace_trans_ bold_transform.inputs.resampling_dim = resampling_dim bold_transform.inputs.data_type = os.environ["rabies_data_type"] - merge = pe.Node(Merge(), name='merge', mem_gb=5) + merge = pe.Node(Merge(), name='merge', mem_gb=3) merge.inputs.data_type = os.environ["rabies_data_type"] - merge.plugin_args = {'qsub_args': '-pe smp %s' % (str(4*int(os.environ["min_proc"]))), 'overwrite': True} + merge.plugin_args = {'qsub_args': '-pe smp %s' % (str(3*int(os.environ["min_proc"]))), 'overwrite': True} # Generate a new BOLD reference bold_reference_wf = init_bold_reference_wf() diff --git a/rabies/preprocess_bold_pkg/utils.py b/rabies/preprocess_bold_pkg/utils.py index 3177b46..4ccc526 100644 --- a/rabies/preprocess_bold_pkg/utils.py +++ b/rabies/preprocess_bold_pkg/utils.py @@ -336,7 +336,13 @@ def _run_interface(self, runtime): import nibabel as nb import os img=nb.load(self.inputs.in_file) - resample_image(nb.load(self.inputs.ref_file), self.inputs.data_type, img_dim=self.inputs.resampling_dim).to_filename('resampled.nii.gz') + + if not self.inputs.resampling_dim=='origin': + resample_image(nb.load(self.inputs.ref_file), self.inputs.data_type, img_dim=self.inputs.resampling_dim).to_filename('resampled.nii.gz') + else: + shape=img.header.get_zooms() + dims="%sx%sx%s" % (shape[0],shape[1],shape[2]) + resample_image(nb.load(self.inputs.ref_file), self.inputs.data_type, img_dim=dims).to_filename('resampled.nii.gz') #tranforms is a list of transform files, set in order of call within antsApplyTransforms transform_string=""