本文整理汇总了Python中msct_image.Image.denoise_ornlm方法的典型用法代码示例。如果您正苦于以下问题:Python Image.denoise_ornlm方法的具体用法?Python Image.denoise_ornlm怎么用?Python Image.denoise_ornlm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msct_image.Image
的用法示例。
在下文中一共展示了Image.denoise_ornlm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from msct_image import Image [as 别名]
# 或者: from msct_image.Image import denoise_ornlm [as 别名]
def __init__(self, target_fname, sc_seg_fname, t2_data=None, denoising=True):
self.t2star = 't2star.nii.gz'
self.sc_seg = 't2star_sc_seg.nii.gz'
self.t2 = 't2.nii.gz'
self.t2_seg = 't2_seg.nii.gz'
self.t2_landmarks = 't2_landmarks.nii.gz'
self.resample_to = 0.3
sct.run('cp ../' + target_fname + ' ./' + self.t2star)
sct.run('cp ../' + sc_seg_fname + ' ./' + self.sc_seg)
nx, ny, nz, nt, self.original_px, self.original_py, pz, pt = sct.get_dimension(self.t2star)
if round(self.original_px, 2) != self.resample_to or round(self.original_py, 2) != self.resample_to:
self.t2star = resample_image(self.t2star, npx=self.resample_to, npy=self.resample_to)
self.sc_seg = resample_image(self.sc_seg, binary=True, npx=self.resample_to, npy=self.resample_to)
t2star_im = Image(self.t2star)
if denoising:
t2star_im.denoise_ornlm()
t2star_im.save()
self.t2star = t2star_im.file_name + t2star_im.ext
'''
status, t2_star_orientation = sct.run('sct_orientation -i ' + self.t2star)
self.original_orientation = t2_star_orientation[4:7]
'''
self.original_orientation = t2star_im.orientation
self.square_mask = crop_t2_star(self.t2star, self.sc_seg, box_size=75)
self.treated_target = sct.extract_fname(self.t2star)[1] + '_seg_in_croped.nii.gz'
self.level_fname = None
if t2_data is not None:
sct.run('cp ../' + t2_data[0] + ' ./' + self.t2)
sct.run('cp ../' + t2_data[1] + ' ./' + self.t2_seg)
sct.run('cp ../' + t2_data[2] + ' ./' + self.t2_landmarks)
self.level_fname = compute_level_file(self.t2star, self.sc_seg, self.t2, self.t2_seg, self.t2_landmarks)