27e4a648a96c76de6b7ed24ea95ea76ee17f623d,pynets/registration/register.py,FmriReg,atlas2t1wmni_align,#FmriReg#Any#Any#Any#,773
Before Change
atlas_img = nib.load(aligned_atlas_t1mni)
atlas_data = np.around(np.asarray(atlas_img.dataobj)).astype("int16")
img = nib.Nifti1Image(atlas_data.astype("int16"), affine=atlas_img.affine,header=atlas_img.header)
if len(img.header.extensions) != 0:
img.header.extensions.clear()
nib.save(img, aligned_atlas_t1mni)
After Change
from nilearn.image import resample_img
aligned_atlas_t1mni = "%s%s%s%s" % (self.anat_path, "/", atlas, "_t1w_mni.nii.gz")
gm_mask_mni = "%s%s%s%s" % (self.anat_path, "/", self.t1w_name, "_gm_mask_t1w_mni.nii.gz")
gm_mask_mni_atlas_res = "%s%s%s%s%s" % (self.anat_path, "/", atlas, self.t1w_name, "_gm_mask_t1w_mni.nii.gz")
aligned_atlas_t1mni_gm = "%s%s%s%s" % (self.anat_path, "/", atlas, "_t1w_mni_gm.nii.gz")
uatlas_filled = "%s%s%s%s" % (self.anat_path, "/", atlas, "_filled.nii.gz")
os.system("fslmaths {} -add {} -mas {} {}".format(self.input_mni_brain, uatlas, self.input_mni_mask,
uatlas_filled))
regutils.align(uatlas_filled, self.t1_aligned_mni, init=None, xfm=self.atlas2t1wmni_xfm_init,
out=None, dof=12, searchrad=True, interp="nearestneighbour", cost="mutualinfo")
if uatlas_parcels is not None:
regutils.applyxfm(self.t1_aligned_mni, uatlas_parcels, self.atlas2t1wmni_xfm_init, aligned_atlas_t1mni,
interp="nearestneighbour")
else:
regutils.applyxfm(self.t1_aligned_mni, uatlas, self.atlas2t1wmni_xfm_init, aligned_atlas_t1mni,
interp="nearestneighbour")
try:
regutils.apply_warp(self.t1_aligned_mni, self.gm_mask_thr, gm_mask_mni, warp=self.warp_t1w2mni,
xfm=self.t12mni_xfm_init, interp="nn", sup=True)
except:
regutils.applyxfm(self.t1_aligned_mni, self.gm_mask_thr, self.t12mni_xfm_init, gm_mask_mni,
interp="nearestneighbour")
// Set intensities to int
atlas_img = nib.load(aligned_atlas_t1mni)
gm_mask_img_res = resample_img(nib.load(gm_mask_mni), target_affine=atlas_img.affine,
target_shape=atlas_img.shape)
nib.save(gm_mask_img_res, gm_mask_mni_atlas_res)
os.system("fslmaths {} -bin {}".format(gm_mask_mni_atlas_res, gm_mask_mni_atlas_res))
os.system("fslmaths {} -mas {} {}".format(aligned_atlas_t1mni, gm_mask_mni_atlas_res, aligned_atlas_t1mni_gm))
gm_mask_img_res.uncache()
atlas_img.uncache()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: dPys/PyNets
Commit Name: 27e4a648a96c76de6b7ed24ea95ea76ee17f623d
Time: 2020-01-02
Author: dpisner@utexas.edu
File Name: pynets/registration/register.py
Class Name: FmriReg
Method Name: atlas2t1wmni_align
Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: a1d23bccc38b8f5361be29d7e6341efb7b48fa28
Time: 2020-08-24
Author: kamifai14@gmail.com
File Name: modules/blocking/blocking.py
Class Name: Module
Method Name: run
Project Name: Microsoft/MMdnn
Commit Name: fdeeaff5e452e257bf3a3dd76e25c81304cc4c98
Time: 2020-03-15
Author: linmajia@users.noreply.github.com
File Name: mmdnn/conversion/examples/tensorflow/vis_meta.py
Class Name:
Method Name: _main