def read_matrix(self, ijk_origin, ijk_size, ijk_step,
                  time = 0, progress = None):

    from numpy import dtype
    element_size = dtype(self.element_type).itemsize
    d = self.priism_data
    xsize, ysize, zsize = d.data_size
    bytes = xsize * ysize * zsize * element_size
    w = self.wave_index
    nw = d.num_waves
    ao = d.axis_order

    if ao == 1: # XYWZT
      orig, size, step, fsize = [(vi,vj,nw*vk) for (vi,vj,vk) in
                                 (ijk_origin, ijk_size, ijk_step, d.data_size)]
      orig = (orig[0], orig[1], orig[2] + w)
      base = d.data_offset + time * bytes * nw
    else:
      orig, size, step, fsize = ijk_origin, ijk_size, ijk_step, d.data_size
      if ao == 0: # XYZTW
        vnum = w * d.num_times + time
      elif ao == 2: # XYZWT
        vnum = w + nw * time
      base = d.data_offset + vnum * bytes

    from VolumeData.readarray import read_array
    matrix = read_array(d.path, base, orig, size, step,
                        fsize, self.element_type, d.swap_bytes, progress)
    return matrix
  def matrix(self, ijk_origin, ijk_size, ijk_step, progress):

    from VolumeData.readarray import read_array
    data = read_array(self.path, self.data_offset + 4,
                      ijk_origin, ijk_size, ijk_step, self.size,
                      self.value_type, self.swap, progress)
    return data
Esempio n. 3
0
    def read_matrix(self,
                    ijk_origin,
                    ijk_size,
                    ijk_step,
                    time=0,
                    progress=None):

        from numpy import dtype
        element_size = dtype(self.element_type).itemsize
        d = self.priism_data
        xsize, ysize, zsize = d.data_size
        bytes = xsize * ysize * zsize * element_size
        w = self.wave_index
        nw = d.num_waves
        ao = d.axis_order

        if ao == 1:  # XYWZT
            orig, size, step, fsize = [
                (vi, vj, nw * vk) for (vi, vj, vk) in (ijk_origin, ijk_size,
                                                       ijk_step, d.data_size)
            ]
            orig = (orig[0], orig[1], orig[2] + w)
            base = d.data_offset + time * bytes * nw
        else:
            orig, size, step, fsize = ijk_origin, ijk_size, ijk_step, d.data_size
            if ao == 0:  # XYZTW
                vnum = w * d.num_times + time
            elif ao == 2:  # XYZWT
                vnum = w + nw * time
            base = d.data_offset + vnum * bytes

        from VolumeData.readarray import read_array
        matrix = read_array(d.path, base, orig, size, step, fsize,
                            self.element_type, d.swap_bytes, progress)
        return matrix
Esempio n. 4
0
    def matrix(self, ijk_origin, ijk_size, ijk_step, progress):

        from VolumeData.readarray import read_array
        data = read_array(self.path, self.data_offset + 4, ijk_origin,
                          ijk_size, ijk_step, self.size, self.value_type,
                          self.swap, progress)
        return data
Esempio n. 5
0
    def read_matrix(self, ijk_origin, ijk_size, ijk_step, progress):

        from numpy import float32
        from VolumeData.readarray import read_array
        matrix = read_array(self.path, self.data_offset, ijk_origin, ijk_size,
                            ijk_step, self.data_size, float32, self.swap_bytes,
                            progress)
        return matrix
  def read_matrix(self, ijk_origin, ijk_size, ijk_step, progress):

    from VolumeData.readarray import read_array
    matrix = read_array(self.path, self.data_offset,
                        ijk_origin, ijk_size, ijk_step,
                        self.data_size, self.element_type, self.swap_bytes,
                        progress)
    return matrix
  def read_matrix(self, ijk_origin, ijk_size, ijk_step, progress):

    from numpy import float32
    from VolumeData.readarray import read_array
    matrix = read_array(self.path, self.data_offset,
                        ijk_origin, ijk_size, ijk_step,
                        self.data_size, float32, self.swap_bytes,
                        progress)
    return matrix
    def matrix(self, ijk_origin, ijk_size, ijk_step, progress):

        from numpy import little_endian, float32
        file_little_endian = (self.endianness == '<')
        swap = (little_endian != file_little_endian)

        from VolumeData.readarray import read_array
        data = read_array(self.path, self.data_offset, ijk_origin, ijk_size,
                          ijk_step, self.extent, float32, swap, progress)
        return data
Esempio n. 9
0
	def matrix(self, ijk_origin, ijk_size, ijk_step, progress):

		from numpy import little_endian, float32
		file_little_endian = (self.endianness == '<')
		swap = (little_endian != file_little_endian)

		from VolumeData.readarray import read_array
		data = read_array(self.path, self.data_offset,
				  ijk_origin, ijk_size, ijk_step,
				  self.extent, float32, swap, progress)
		return data
    def read_matrix(self, ijk_origin, ijk_size, ijk_step, progress):

        # ijk correspond to xyz.  crs refers to fast,medium,slow matrix file axes.
        crs_origin = [ijk_origin[a] for a in self.crs_to_ijk]
        crs_size = [ijk_size[a] for a in self.crs_to_ijk]
        crs_step = [ijk_step[a] for a in self.crs_to_ijk]

        from VolumeData.readarray import read_array
        matrix = read_array(self.path, self.data_offset, crs_origin, crs_size,
                            crs_step, self.matrix_size, self.element_type,
                            self.swap_bytes, progress)
        if not matrix is None:
            matrix = self.permute_matrix_to_xyz_axis_order(matrix)

        return matrix
Esempio n. 11
0
  def read_matrix(self, ijk_origin, ijk_size, ijk_step, progress):

    # ijk correspond to xyz.  crs refers to fast,medium,slow matrix file axes.
    crs_origin = [ijk_origin[a] for a in self.crs_to_ijk]
    crs_size = [ijk_size[a] for a in self.crs_to_ijk]
    crs_step = [ijk_step[a] for a in self.crs_to_ijk]

    from VolumeData.readarray import read_array
    matrix = read_array(self.path, self.data_offset,
                        crs_origin, crs_size, crs_step,
                        self.matrix_size, self.element_type, self.swap_bytes,
                        progress)
    if not matrix is None:
      matrix = self.permute_matrix_to_xyz_axis_order(matrix)
    
    return matrix
    def read_matrix(self, cname, ijk_origin, ijk_size, ijk_step, progress):

        from numpy import uint8, int16, float32, array
        array_specs = {
            'bump': (32, 0, uint8),
            'contact': (4, 0, int16),
            'vdw attract': (16, 0, float32),
            'vdw repel': (16, 1, float32),
            'electrostatic': (16, 2, float32),
        }

        offset, array_num, type = array_specs[cname]
        type_size = array([], type).itemsize
        array_bytes = self.array_size * type_size
        base = offset + array_num * array_bytes

        from VolumeData.readarray import read_array
        matrix = read_array(self.path, base, ijk_origin, ijk_size, ijk_step,
                            self.data_size, type, self.byte_swap, progress)

        return matrix
Esempio n. 13
0
  def read_matrix(self, cname, ijk_origin, ijk_size, ijk_step, progress):

    from numpy import uint8, int16, float32, array
    array_specs = {
      'bump': (32, 0, uint8),
      'contact': (4, 0, int16),
      'vdw attract': (16, 0, float32),
      'vdw repel': (16, 1, float32),
      'electrostatic': (16, 2, float32),
      }

    offset, array_num, type = array_specs[cname]
    type_size = array([], type).itemsize
    array_bytes = self.array_size * type_size
    base = offset + array_num * array_bytes

    from VolumeData.readarray import read_array
    matrix = read_array(self.path, base, ijk_origin, ijk_size, ijk_step,
                        self.data_size, type, self.byte_swap, progress)

    return matrix