From 382ed853f2941393659ea85492f2ec27f166286a Mon Sep 17 00:00:00 2001 From: Dreek Fire Date: Thu, 9 Mar 2023 13:24:04 -0800 Subject: [PATCH] Replace default colormap option with turbo for single-channel output (#1568) replace default colormap option with turbo for single-channel output Co-authored-by: Matthew Tancik --- nerfstudio/viewer/app/src/reducer.js | 3 --- nerfstudio/viewer/server/viewer_utils.py | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nerfstudio/viewer/app/src/reducer.js b/nerfstudio/viewer/app/src/reducer.js index d8335c80d..76a21fbb8 100644 --- a/nerfstudio/viewer/app/src/reducer.js +++ b/nerfstudio/viewer/app/src/reducer.js @@ -71,9 +71,6 @@ const initialState = { }; function setData(newState, state, path, data) { - if (path === 'colormap_options') { - newState.colormap_choice = 'default'; // eslint-disable-line no-param-reassign - } if (path.length === 1) { newState[path[0]] = data; // eslint-disable-line no-param-reassign } else { diff --git a/nerfstudio/viewer/server/viewer_utils.py b/nerfstudio/viewer/server/viewer_utils.py index 37580c7e1..79370b184 100644 --- a/nerfstudio/viewer/server/viewer_utils.py +++ b/nerfstudio/viewer/server/viewer_utils.py @@ -753,10 +753,12 @@ class ViewerState: if self.output_type_changed or self.prev_colormap_type is None: self.prev_colormap_type = ColormapTypes.DEFAULT colormap_options = [] + self.vis["renderingState/colormap_options"].write(list(ColormapTypes)) if outputs[reformatted_output].shape[-1] == 3: colormap_options = [ColormapTypes.DEFAULT] if outputs[reformatted_output].shape[-1] == 1 and outputs[reformatted_output].dtype == torch.float: - colormap_options = list(ColormapTypes) + self.prev_colormap_type = ColormapTypes.TURBO + colormap_options = list(ColormapTypes)[1:] self.output_type_changed = False self.vis["renderingState/colormap_choice"].write(self.prev_colormap_type) self.vis["renderingState/colormap_options"].write(colormap_options)