Skip to content

Commit

Permalink
- Create RelaxMesh subvolume processor. Also adds private interface…
Browse files Browse the repository at this point in the history
…s to SubvolumeProcessors for data paths supporting internal vs external data loading.

- Allow `inplane_force` to work with non-scaler strides
- Fix JAX serialization of `IntegrationConfig`

PiperOrigin-RevId: 684494663
  • Loading branch information
timblakely authored and copybara-github committed Oct 10, 2024
1 parent ec1f151 commit ce73f91
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions connectomics/volume/subvolume_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from connectomics.common import file
from connectomics.common import utils
from connectomics.volume import descriptor
from connectomics.volume import mask
from connectomics.volume import metadata
from connectomics.volume import subvolume
import dataclasses_json
import numpy as np
Expand Down Expand Up @@ -282,6 +284,38 @@ def crop_box_and_data(
bx, by, bz = np.array(data.shape[:0:-1]) - back
return Subvolume(data[:, fz:bz, fy:by, fx:bx], cropped_box)

# TODO(timblakely): Correct the return value from Any.
def _open_volume(
self,
path_or_volume: (
file.PathLike | metadata.VolumeMetadata | metadata.DecoratedVolume
),
) -> Any:
raise NotImplementedError(
'This function needs to be defined in a subclass.'
)

def _get_mask_configs(
self, mask_configs: str | mask.MaskConfigs
) -> mask.MaskConfigs:
raise NotImplementedError(
'This function needs to be defined in a subclass.'
)

def _get_metadata(self, path: file.PathLike) -> metadata.VolumeMetadata:
raise NotImplementedError(
'This function needs to be defined in a subclass.'
)

def _build_mask(
self,
mask_configs: mask.MaskConfigs,
box: bounding_box.BoundingBoxBase,
) -> Any:
raise NotImplementedError(
'This function needs to be defined in a subclass.'
)


def get_processor(config: SubvolumeProcessorConfig) -> SubvolumeProcessor:
name = config.name
Expand Down

0 comments on commit ce73f91

Please sign in to comment.