Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(27) | Call(18) | Derive(0) | Import(9)
src/n/i/nibabel-1.3.0/nibabel/nifti1.py nibabel(Download)
import numpy.linalg as npl from .py3k import ZEROB, ints2bytes, asbytes, asstr from .volumeutils import Recoder, make_dt_codes, endian_codes from .spatialimages import HeaderDataError, ImageFileError
n_params = len(recoder.parameters[code]) params = (float(hdr['intent_p%d' % (i+1)]) for i in range(n_params)) name = asstr(np.asscalar(hdr['intent_name'])) return label, tuple(params), name
# unrecognized nii magic string, oh dear rep.problem_msg = ('magic string "%s" is not valid' % asstr(magic)) rep.problem_level = 45 if fix:
src/n/i/nibabel-1.3.0/nibabel/nicom/csareader.py nibabel(Download)
import numpy as np from ..py3k import ZEROB, asbytes, asstr from .structreader import Unpacker
if zero_pos == -1: return s return asstr(s[:zero_pos])
src/n/i/nibabel-1.3.0/nibabel/externals/netcdf.py nibabel(Download)
import numpy as np from ..py3k import asbytes, asstr from numpy import fromstring, ndarray, dtype, empty, array, asarray from numpy import little_endian as LITTLE_ENDIAN
for dim in range(count): name = asstr(self._unpack_string()) length = self._unpack_int() or None # None for record dimension self.dimensions[name] = length
attributes = {} for attr in range(count): name = asstr(self._unpack_string()) attributes[name] = self._read_values() return attributes
def _read_var(self): name = asstr(self._unpack_string()) dimensions = [] shape = [] dims = self._unpack_int()
src/n/i/nibabel-1.3.0/nibabel/minc.py nibabel(Download)
from .externals.netcdf import netcdf_file from .py3k import asbytes, asstr from .spatialimages import SpatialImage
dtt = np.dtype(np.float64) else: signtype = asstr(self._image.signtype) dtt = _dt_dict[(typecode, signtype)] return np.dtype(dtt).newbyteorder('>')
src/n/i/nibabel-HEAD/nibabel/externals/netcdf.py nibabel(Download)
import numpy as np from ..py3k import asbytes, asstr from numpy import fromstring, ndarray, dtype, empty, array, asarray from numpy import little_endian as LITTLE_ENDIAN
for dim in range(count): name = asstr(self._unpack_string()) length = self._unpack_int() or None # None for record dimension self.dimensions[name] = length
attributes = {} for attr in range(count): name = asstr(self._unpack_string()) attributes[name] = self._read_values() return attributes
def _read_var(self): name = asstr(self._unpack_string()) dimensions = [] shape = [] dims = self._unpack_int()
src/n/i/nibabel-1.3.0/nibabel/trackvis.py nibabel(Download)
import numpy.linalg as npl from .py3k import asbytes, asstr from .volumeutils import (native_code, swapped_code, endian_codes, allopen, rec2dict)
'field value %s' % (aff_zooms, zooms)) aff_order = ''.join(aff2axcodes(affine)) voxel_order = asstr(np.asscalar(hdr['voxel_order'])) if voxel_order == '': voxel_order = 'LPS' # trackvis default
# Next we check against the 'voxel_order' field if present and not empty. try: voxel_order = asstr(np.asscalar(trk_hdr['voxel_order'])) except KeyError, ValueError: voxel_order = ''
src/n/i/nibabel-HEAD/nibabel/nicom/utils.py nibabel(Download)
""" Utilities for working with DICOM datasets """ from __future__ import division, print_function, absolute_import from ..py3k import asstr
is_regex = hasattr(creator, 'search') if not is_regex: # assume string / bytes creator = asstr(creator) for element in dcm_data: # Assumed ordered by tag (groupno, elno) grpno, elno = element.tag.group, element.tag.elem
if element.VR not in ('LO', 'OB'): continue name = asstr(element.value) if is_regex: if creator.search(name) != None:
src/n/i/nibabel-HEAD/nibabel/trackvis.py nibabel(Download)
import numpy.linalg as npl from .py3k import asstr from .volumeutils import (native_code, swapped_code, endian_codes, rec2dict) from .volumeutils import BinOpener
'field value %s' % (aff_zooms, zooms)) aff_order = ''.join(aff2axcodes(affine)) voxel_order = asstr(np.asscalar(hdr['voxel_order'])) if voxel_order == '': voxel_order = 'LPS' # trackvis default
# Next we check against the 'voxel_order' field if present and not empty. try: voxel_order = asstr(np.asscalar(trk_hdr['voxel_order'])) except (KeyError, ValueError): voxel_order = ''
src/n/i/nibabel-HEAD/nibabel/nifti1.py nibabel(Download)
import numpy.linalg as npl from .py3k import asstr from .volumeutils import Recoder, make_dt_codes, endian_codes from .spatialimages import HeaderDataError, ImageFileError
n_params = len(recoder.parameters[code]) params = (float(hdr['intent_p%d' % (i+1)]) for i in range(n_params)) name = asstr(np.asscalar(hdr['intent_name'])) return label, tuple(params), name
return hdr, rep rep.problem_msg = ('magic string "%s" is not valid' % asstr(magic)) rep.problem_level = 45 if fix: