Skip to content

Commit

Permalink
fix neuroglancer from CartesianSpace to CoordinateSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
xiuliren committed May 3, 2022
1 parent 231588e commit 2ac2f6c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions chunkflow/chunk/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ def properties(self) -> dict:
props['voxel_size'] = self.voxel_size
return props

@property
def size(self):
return self.array.size

@property
def slices(self) -> tuple:
"""
Expand Down
10 changes: 5 additions & 5 deletions chunkflow/flow/neuroglancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _append_synapse_annotation_layer(self, viewer_state: ng.viewer_state.ViewerS
viewer_state.layers.append(
name=name,
layer=ng.LocalAnnotationLayer(
dimensions=ng.CartesianSpace(names=['z', 'y', 'x'], units="nm", scales=(1,1,1)),
dimensions=ng.CoordinateSpace(names=['z', 'y', 'x'], units="nm", scales=(1,1,1)),
annotation_properties=[
ng.AnnotationPropertySpec(
id='color',
Expand Down Expand Up @@ -94,7 +94,7 @@ def _append_point_annotation_layer(self, viewer_state: ng.viewer_state.ViewerSta
viewer_state.layers.append(
name=name,
layer=ng.LocalAnnotationLayer(
dimensions=ng.CartesianSpace(names=['z', 'y', 'x'], units="nm", scales=(1, 1, 1)),
dimensions=ng.CoordinateSpace(names=['z', 'y', 'x'], units="nm", scales=(1, 1, 1)),
annotation_properties=[
ng.AnnotationPropertySpec(
id='color',
Expand All @@ -119,7 +119,7 @@ def _append_point_annotation_layer(self, viewer_state: ng.viewer_state.ViewerSta

def _append_image_layer(self, viewer_state: ng.viewer_state.ViewerState, chunk_name: str, chunk: Chunk):
voxel_size = self._get_voxel_size(chunk)
dimensions = ng.CartesianSpace(
dimensions = ng.CoordinateSpace(
scales=voxel_size,
units=['nm', 'nm', 'nm'],
names=['z', 'y', 'x']
Expand Down Expand Up @@ -149,7 +149,7 @@ def _append_segmentation_layer(self, viewer_state: ng.viewer_state.ViewerState,
assert chunk.min() >= 0
chunk = chunk.astype(np.uint64)
voxel_size = self._get_voxel_size(chunk)
dimensions = ng.CartesianSpace(
dimensions = ng.CoordinateSpace(
scales=voxel_size,
units=['nm', 'nm', 'nm'],
names=['z', 'y', 'x']
Expand Down Expand Up @@ -191,7 +191,7 @@ def _append_probability_map_layer(self, viewer_state: ng.viewer_state.ViewerStat
toNormalized(getDataValue(2))));
}
"""
dimensions = ng.CartesianSpace(
dimensions = ng.CoordinateSpace(
scales=(1, ) + voxel_size,
units=['', 'nm', 'nm', 'nm'],
names=['c^', 'z', 'y', 'x']
Expand Down
1 change: 1 addition & 0 deletions chunkflow/flow/read_precomputed.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(self,
mip=self.mip,
cache=False,
green_threads=True)
#parallel=True,

def __call__(self, output_bbox: BoundingBox):
# if we do not clone this bounding box,
Expand Down
1 change: 1 addition & 0 deletions chunkflow/flow/write_precomputed.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self,
cache=False,
green_threads=True,
progress=True)
#parallel=True,

if upload_log:
log_path = os.path.join(volume_path, 'log')
Expand Down

0 comments on commit 2ac2f6c

Please sign in to comment.