示例#1
0
文件: read.go 项目: tartavull/dvid
// GetVolume retrieves a n-d volume from a version node given a geometry of labels.
func (d *Data) GetVolume(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) ([]byte, error) {
	r, err := imageblk.GetROI(v, roiname, vox)
	if err != nil {
		return nil, err
	}
	if err := d.GetLabels(v, vox, r); err != nil {
		return nil, err
	}
	return vox.Data(), nil
}
示例#2
0
文件: read.go 项目: tartavull/dvid
// GetImage retrieves a 2d image from a version node given a geometry of labels.
func (d *Data) GetImage(v dvid.VersionID, vox *Labels, roiname dvid.InstanceName) (*dvid.Image, error) {
	r, err := imageblk.GetROI(v, roiname, vox)
	if err != nil {
		return nil, err
	}
	if err := d.GetLabels(v, vox, r); err != nil {
		return nil, err
	}
	return vox.GetImage2d()
}