本文整理汇总了Python中lib.images.Images.append方法的典型用法代码示例。如果您正苦于以下问题:Python Images.append方法的具体用法?Python Images.append怎么用?Python Images.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.images.Images
的用法示例。
在下文中一共展示了Images.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = 'mrtrix'
#Get images
mask = self.getRegistrationImage('mask', 'resample')
#Build qa images
tags = (
('nufo', 5, 'nufo'),
('afd', 5,'afd')
)
for postfix, vmax, description in tags:
image = self.getImage('dwi', postfix)
if image:
imageQa = self.plot3dVolume(
image, fov=mask, vmax=vmax,
colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
return qaImages
示例2: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = 'fsl'
#Get images
mask = self.getRegistrationImage('mask', 'resample')
#Build qa images
tags = (
('fa', 0.7, 'Fractional anisotropy'),
('ad', 0.005, 'Axial Diffusivity'),
('md', 0.005, 'Mean Diffusivity'),
('rd', 0.005, 'Radial Diffusivity'),
)
for postfix, vmax, description in tags:
image = self.getImage('dwi', postfix)
if image:
imageQa = self.plot3dVolume(
image, fov=mask, vmax=vmax,
colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
#Build SSE image
sse = self.getImage('dwi', 'sse')
sseQa = self.plot3dVolume(
sse, fov=mask, postfix=softwareName, colorbar=True)
qaImages.append((sseQa, 'Sum of squared errors'))
return qaImages
示例3: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
#Get images
dwiNative = self.getPreparationImage('dwi')
dwiCorrected = self.getCorrectionImage('dwi', 'corrected')
dwiDenoised = self.getDenoisingImage('dwi', 'denoise')
noiseMask = self.getImage('mask', ['corrected', 'noisemask'])
ccMask = self.getImage('aparc_aseg', ['253', 'mask', 'downsample'])
b0 = self.getCorrectionImage('b0', 'corrected')
#Build qa images
tags = (
(dwiNative, 'Native'),
(dwiDenoised, 'denoised'),
(dwiCorrected, 'Corrected'),
)
for dwi, description in tags:
if dwi:
qaImages = self.__noiseAnalysis(dwi, noiseMask, ccMask, qaImages, description)
#Build qa masks images
tags = (
(noiseMask, 'Noise mask'),
(ccMask, 'Corpus callosum mask'),
)
for mask, description in tags:
maskPng = self.buildName(mask, None, 'png')
self.slicerPng(b0, maskPng, maskOverlay=mask, boundaries=mask)
qaImages.append((maskPng, description))
return qaImages
示例4: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = 'mrtrix'
#Set information
information = "Estimation using WLS with {} iteration(s)".format(self.get('iter'))
qaImages.setInformation(information)
#Get images
mask = self.getRegistrationImage('mask', 'resample')
#Build qa images
tags = (
('fa', 0.7, 'Fractional anisotropy'),
('ad', 0.005, 'Axial Diffusivity'),
('md', 0.005, 'Mean Diffusivity'),
('rd', 0.005, 'Radial Diffusivity'),
)
for postfix, vmax, description in tags:
image = self.getImage('dwi', postfix)
if image:
imageQa = self.plot3dVolume(
image, fov=mask, vmax=vmax,
colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
return qaImages
示例5: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
# Get images
dwiNative = self.getPreparationImage("dwi")
dwiCorrected = self.getCorrectionImage("dwi", "corrected")
dwiDenoised = self.getDenoisingImage("dwi", "denoise")
noiseMask = self.getImage("mask", ["corrected", "noisemask"])
ccMask = self.getImage("aparc_aseg", ["253", "mask", "downsample"])
b0 = self.getCorrectionImage("b0", "corrected")
# Build qa images
tags = ((dwiNative, "Native"), (dwiDenoised, "denoised"), (dwiCorrected, "Corrected"))
for dwi, description in tags:
if dwi:
qaImages = self.__noiseAnalysis(dwi, noiseMask, ccMask, qaImages, description)
# Build qa masks images
tags = ((noiseMask, "Noise mask"), (ccMask, "Corpus callosum mask"))
for mask, description in tags:
maskPng = self.buildName(mask, None, "png")
self.slicerPng(b0, maskPng, maskOverlay=mask, boundaries=mask)
qaImages.append((maskPng, description))
return qaImages
示例6: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
information = "Warning: due to storage restriction, streamlines were " \
"downsampled. Even if there is no difference in structural " \
"connectivity, you should be careful before computing any " \
"metrics along these streamlines.\n To run toad without this " \
"downsampling, please refer to the documentation."
if self.defaultQuery:
# get images
norm = self.getRegistrationImage("norm", "resample")
self.__buildNameTractQuerierOutputs()
# images production
tags = (
(self.queries[0],
'Corpus Callosum',
95, 60, 40, -80, 0, 160),
(self.queries[1],
'Inferior Fronto Occipital tract left',
95, 80, 40, -90, 0, 90),
(self.queries[2],
'Inferior Fronto Occipital tract right',
95, 80, 40, -90, 0, -90),
(self.queries[3],
'inferior Longitudinal Fasciculus left',
95, 80, 40, -90, 0, 90),
(self.queries[4],
'Inferior Longitudinal Fasciculus right',
95, 80, 40, -90, 0, -90),
(self.queries[5],
'Uncinate Fasciculus left',
95, 80, 40, -90, 0, 90),
(self.queries[6],
'Uncinate Fasciculus right',
95, 80, 40, -90, 0, -90),
(self.queries[7],
'Corticospinal tract Left',
95, 80, 40, -90, 0, 160),
(self.queries[8],
'Corticospinal tract right',
95, 80, 40, -90, 0, 200),
)
for data, description, xSlice, ySlice, zSlice, xRot, yRot, zRot in tags:
if data:
imageQa = self.plotTrk(data, norm, None, xSlice, ySlice, zSlice, xRot, yRot, zRot)
qaImages.append((imageQa, description))
else:
information = """
Because you didn't choose default queries and dictionnary,
we are not able to create proper screenshots of the output bundles.
"""
qaImages.setInformation(information)
return qaImages
示例7: meetRequirement
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def meetRequirement(self):
images = Images((self.getPreparationImage('dwi'), 'diffusion weighted'),
(self.getParcellationImage('norm'), 'freesurfer normalize'),
(self.getParcellationImage('mask'), 'freesurfer mask'),
(self.getPreparationImage('grad', None, 'bvals'), 'gradient .bvals encoding file'),
(self.getPreparationImage('grad', None, 'bvecs'), 'gradient .bvecs encoding file'),
(self.getPreparationImage('grad', None, 'b'), 'gradient .b encoding file'))
#if fieldmap available
if Images(self.getPreparationImage("mag") , self.getPreparationImage("phase")).isAllImagesExists():
images.append((self.getParcellationImage('anat', 'freesurfer'),"freesurfer anatomical"))
return images
示例8: isDirty
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def isDirty(self):
images = Images()
dwi = self.getUpsamplingImage('dwi', 'upsample')
if mriutil.getNbDirectionsFromDWI(dwi) <= 45 and not self.get('forceHardi'):
if 'deterministic' in self.get('algorithm'):
images.append((
self.getImage('dwi', 'tensor_det', 'trk'),
"deterministic tensor connectome matrix from a streamlines"
))
if 'probabilistic' in self.get('algorithm'):
images.append((
self.getImage('dwi', 'tensor_prob', 'trk'),
"probabilistic tensor connectome matrix from a streamlines"
))
else:
images.append((
self.getImage('dwi', 'hardi_prob', 'trk'),
"tckgen hardi probabilistic streamlines tractography"
))
if self.get('sift'):
images.append((
self.getImage('dwi', 'tcksift', 'trk'), 'tcksift'))
return images
示例9: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
#Information on denoising algorithm
information = 'Denoising was done using the {} algorithm'.format(self.algorithm)
if self.algorithm == "nlmeans" and \
self.config.get("denoising", "number_array_coil") == "32":
information = "NLMEANS algorithm is not yet implemented for 32 " \
"coils channels images, "
if self.config.getboolean("general", "matlab_available"):
information += "set algorithm to `lpca` or `aonlm` or "
information += "set `ignore: True` into the [denoising] section " \
"of your config.cfg file."
if self.matlabWarning:
information = "Algorithm `aonlm` or `lpca` was set for the " \
"denoising, but Matlab is not available for this server. "\
"Please install and configure Matlab or set `ignore: True`"\
" into the [denoising] section of your config.cfg file."
qaImages.extend(Images((False, 'Denoised diffusion image')))
qaImages.setInformation(information)
#Get images
dwi = self.getPreparationImage("dwi")
dwiDenoised = self.getImage('dwi', 'denoise')
brainMask = self.getImage('mask', 'resample')
b0 = self.getImage('b0')
noiseMask = self.getImage('dwi', 'noise_mask')
#Build qa images
if dwiDenoised:
dwiDenoisedQa = self.plot4dVolume(dwiDenoised, fov=brainMask)
qaImages.append((dwiDenoisedQa, 'Denoised diffusion image'))
dwiCompareQa = self.compare4dVolumes(
dwi, dwiDenoised, fov=brainMask)
qaImages.append((dwiCompareQa, 'Before and after denoising'))
if self.algorithm == "nlmeans":
if self.sigmaVector != None:
sigmaQa = self.plotSigma(self.sigmaVector, dwiDenoised)
qaImages.append(
(sigmaQa, 'Sigmas from the nlmeans algorithm'))
if noiseMask:
noiseMaskQa = self.plot3dVolume(
b0, edges=noiseMask, fov=noiseMask)
qaImages.append(
(noiseMaskQa, 'Noise mask from the nlmeans algorithm'))
return qaImages
示例10: isDirty
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def isDirty(self):
images = Images()
if self.__nbDirections <= 45:
if 'deterministic' in self.get('algorithm'):
images.extend(Images((self.getImage('dwi', 'tensor_det', 'tck'), "deterministic tensor connectome matrix from a streamlines")))
if 'probabilistic' in self.get('algorithm'):
images.extend(Images((self.getImage('dwi', 'tensor_prob', 'tck'), "probabilistic tensor connectome matrix from a streamlines")))
else:
if 'hardi' in self.get('algorithm'):
images.append((self.getImage('dwi', 'hardi_prob', 'tck'), "tckgen hardi probabilistic streamlines tractography"))
if 'sift' in self.get('algorithm'):
images.extend(Images((self.getImage('dwi', 'tcksift', 'tck'), 'tcksift')))
return images
示例11: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = 'dipy'
#Set information
information = "Fit method: {}".format(self.get('fitMethod'))
qaImages.setInformation(information)
# mask image
mask = self.getRegistrationImage('mask', 'resample')
# Produce tensor ellipsoids image
dwi = self.getUpsamplingImage('dwi', 'upsample')
cc = self.getMaskingImage('aparc_aseg', ['253','mask'])
ellipsoidsQa = self.plotReconstruction(
self.__fit, mask, cc, 'tensor', dwi)
qaImages.append((
ellipsoidsQa,
'Coronal slice of tensor ellipsoids in the Corpus Callosum'))
# Build qa images
tags = (
#(['tensor', 'rgb'], 'RGB map'),
('fa', 0.7, 'Fractional anisotropy'),
('ad', 0.005, 'Axial Diffusivity'),
('md', 0.005, 'Mean Diffusivity'),
('rd', 0.005, 'Radial Diffusivity'),
)
for postfix, vmax, description in tags:
image = self.getImage('dwi', postfix)
if image:
imageQa = self.plot3dVolume(
image, fov=mask, vmax=vmax,
colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
return qaImages
示例12: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
tags = (
('anat', self.plot3dVolume, 'High resolution anatomical image'),
('dwi', self.plot4dVolume, 'Diffusion weighted image'),
('b0_ap', self.plot3dVolume, 'B0 AP image'),
('b0_pa', self.plot3dVolume, 'B0 PA image'),
('mag', self.plot3dVolume, 'Magnitude image'),
('phase', self.plot3dVolume, 'Phase image'),
)
for prefix, plotMethod, description in tags:
source = self.getImage(prefix)
if source:
qaImage = plotMethod(source)
qaImages.append((qaImage, description))
return qaImages
示例13: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = "dipy"
# Get images
dwi = self.getUpsamplingImage("dwi", "upsample")
cc = self.getMaskingImage("aparc_aseg", ["253", "mask"])
mask = self.getRegistrationImage("mask", "resample")
# Produce hardi odfs image
data = {"dwiData": self.__dwiData, "csdModel": self.__csdModel}
odfsQa = self.plotReconstruction(data, mask, cc, "hardi_odf", dwi)
qaImages.append((odfsQa, "Coronal slice of hardi CSD ODFs in the Corpus Callosum"))
# Produce hardi peaks image
peaksQa = self.plotReconstruction(self.__csdPeaks, mask, cc, "hardi_peak", dwi)
qaImages.append((peaksQa, "Coronal slice of hardi CSD Peaks in the Corpus Callosum"))
# Build qa images
tags = (("gfa", 1.5, "Generalised Fractional Anisotropy"), ("nufo", 5, "nufo"))
for postfix, vmax, description in tags:
image = self.getImage("dwi", postfix)
if image:
imageQa = self.plot3dVolume(image, fov=mask, vmax=vmax, colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
return qaImages
示例14: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
information = "Warning: due to storage restriction, streamlines were " \
"downsampled. Even if there is no difference in structural " \
"connectivity, you should be careful before computing any " \
"metrics along these streamlines.\n To run toad without this " \
"downsampling, please refer to the documentation."
qaImages.setInformation(information)
#get images
norm = self.getRegistrationImage("norm", "resample")
mask253 = self.getMaskingImage('aparc_aseg',['253','mask'])
#images production
if self.__nbDirections <= 45 and not self.get('forceHardi'):
tags = (
(self.__tckDetRoiTrk,
'fiber crossing aparc_aseg area 253 from a deterministic tensor streamlines'),
(self.__tckProbRoiTrk,
'fiber crossing aparc_aseg area 253 from a probabilistic tensor streamlines'),
)
else:
tags = (
(self.__tckgenRoiTrk,
'fiber crossing aparc_aseg area 253 from a probabilistic hardi streamlines'),
(self.__tcksiftRoiTrk,
'fiber crossing aparc_aseg area 253 from a probabilistic hardi streamlines with sift'),
)
for data, description in tags:
if data is not None:
imageQa = self.plotTrk(data, norm, mask253, None, None, 65, -70, 2.5, 185)
qaImages.append((imageQa, description))
return qaImages
示例15: qaSupplier
# 需要导入模块: from lib.images import Images [as 别名]
# 或者: from lib.images.Images import append [as 别名]
def qaSupplier(self):
"""Create and supply images for the report generated by qa task
"""
qaImages = Images()
softwareName = 'dipy'
#Get images
dwi = self.getUpsamplingImage('dwi', 'upsample')
cc = self.getMaskingImage('aparc_aseg', ['253','mask'])
mask = self.getRegistrationImage('mask', 'resample')
#Produce hardi odfs image
data = {'dwiData':self.__dwiData, 'csdModel':self.__csdModel}
odfsQa = self.plotReconstruction(data, mask, cc, 'hardi_odf', dwi)
qaImages.append((
odfsQa, 'Coronal slice of hardi CSD ODFs in the Corpus Callosum'))
#Produce hardi peaks image
peaksQa = self.plotReconstruction(
self.__csdPeaks, mask, cc, 'hardi_peak', dwi)
qaImages.append((
peaksQa, "Coronal slice of hardi CSD Peaks in the Corpus Callosum"))
#Build qa images
tags = (
('gfa', 1.5, 'Generalised Fractional Anisotropy'),
('nufo', 5, 'nufo'),
)
for postfix, vmax, description in tags:
image = self.getImage('dwi', postfix)
if image:
imageQa = self.plot3dVolume(
image, fov=mask, vmax=vmax,
colorbar=True, postfix=softwareName)
qaImages.append((imageQa, description))
return qaImages