Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: misspell of "scalar" #24

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions bioxelnodes/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,14 @@ def create_layer(volume, layer_name, layer_type="scalar"):
volume = np.amax(volume, -1)
# volume = skimage.color.rgb2gray(volume)

if volume.dtype.kind == 'u':
imax_in = np.iinfo(volume.dtype).max
volume = np.multiply(volume, 255.0 / imax_in, dtype=np.float32)
elif volume.dtype.kind == 'i':
volume = volume.astype(np.float32)
# if volume.dtype.kind == 'u':
# imax_in = np.iinfo(volume.dtype).max
# volume = np.multiply(volume, 255.0 / imax_in, dtype=np.float32)
# elif volume.dtype.kind == 'i':
# volume = volume.astype(np.float32)

# should not change any value!
volume = volume.astype(np.float32)

print(f"Resampling...")
volume = ski.resize(volume,
Expand Down Expand Up @@ -684,15 +687,15 @@ def invoke(self, context, event):

class ImportAsScalarLayer(bpy.types.Operator, ImportVolumeData):
bl_idname = "bioxelnodes.import_as_scalar_layer"
bl_label = "Import as Scale Layer"
bl_description = "Import Volume Data to Container as Scale Layer"
bl_label = "Import as Scalar"
bl_description = "Import Volume Data to Container as Scalar"
read_as = "scalar"


class ImportAsLabelLayer(bpy.types.Operator, ImportVolumeData):
bl_idname = "bioxelnodes.import_as_label_layer"
bl_label = "Import as Label Layer"
bl_description = "Import Volume Data to Container as Label Layer"
bl_label = "Import as Labels"
bl_description = "Import Volume Data to Container as Label"
read_as = "labels"


Expand Down
2 changes: 1 addition & 1 deletion bioxelnodes/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_label_layer_selection(self, context):
# ) # type: ignore

# scalar_layer: bpy.props.EnumProperty(
# name="Scaler Layer",
# name="Scalar Layer",
# items=get_scalar_layer_selection
# ) # type: ignore

Expand Down
Loading