From 2e61267372e9b6e0467d5b5d0dcb99578a58763d Mon Sep 17 00:00:00 2001 From: Tony Tung Date: Fri, 31 Jan 2020 14:25:59 -0600 Subject: [PATCH] Remove instances where we use `expand_dynamic_range` in notebooks (#1762) Replace them with Levels. Test plan: `make -j fast` --- notebooks/BaristaSeq.ipynb | 6 +++--- notebooks/DARTFISH.ipynb | 4 ++-- notebooks/SeqFISH.ipynb | 4 ++-- notebooks/py/BaristaSeq.py | 6 +++--- notebooks/py/DARTFISH.py | 4 ++-- notebooks/py/SeqFISH.py | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/notebooks/BaristaSeq.ipynb b/notebooks/BaristaSeq.ipynb index 4d47f4b8c..cf1f8868c 100644 --- a/notebooks/BaristaSeq.ipynb +++ b/notebooks/BaristaSeq.ipynb @@ -36,7 +36,7 @@ "\n", "import starfish\n", "import starfish.data\n", - "from starfish.types import Axes\n", + "from starfish.types import Axes, Levels\n", "from starfish.util.plot import (\n", " imshow_plane, intensity_histogram, overlay_spot_calls\n", ")\n", @@ -331,7 +331,7 @@ "metadata": {}, "outputs": [], "source": [ - "sbp = starfish.image.Filter.Clip(p_max=100, expand_dynamic_range=True)\n", + "sbp = starfish.image.Filter.Clip(p_max=100, level_method=Levels.SCALE_BY_CHUNK)\n", "scaled = sbp.run(background_corrected, n_processes=1, in_place=False)" ] }, @@ -393,7 +393,7 @@ "metadata": {}, "outputs": [], "source": [ - "sbp = starfish.image.Filter.Clip(p_max=99.8, expand_dynamic_range=True)\n", + "sbp = starfish.image.Filter.Clip(p_max=99.8, level_method=Levels.SCALE_BY_CHUNK)\n", "scaled = sbp.run(background_corrected, n_processes=1, in_place=False)\n", "\n", "f = plot_scaling_result(background_corrected, scaled)" diff --git a/notebooks/DARTFISH.ipynb b/notebooks/DARTFISH.ipynb index 30405708c..2bcf20ac1 100644 --- a/notebooks/DARTFISH.ipynb +++ b/notebooks/DARTFISH.ipynb @@ -27,7 +27,7 @@ "\n", "from starfish import display\n", "from starfish import data, FieldOfView\n", - "from starfish.types import Features, Axes\n", + "from starfish.types import Axes, Features, Levels\n", "\n", "from starfish import IntensityTable\n", "\n", @@ -117,7 +117,7 @@ "metadata": {}, "outputs": [], "source": [ - "sc_filt = Filter.Clip(p_max=100, expand_dynamic_range=True)\n", + "sc_filt = Filter.Clip(p_max=100, level_method=Levels.SCALE_BY_CHUNK)\n", "norm_imgs = sc_filt.run(imgs)" ] }, diff --git a/notebooks/SeqFISH.ipynb b/notebooks/SeqFISH.ipynb index 760b1faa3..655cb8a1e 100644 --- a/notebooks/SeqFISH.ipynb +++ b/notebooks/SeqFISH.ipynb @@ -28,7 +28,7 @@ "\n", "import starfish\n", "import starfish.data\n", - "from starfish.types import Axes, TraceBuildingStrategies" + "from starfish.types import Axes, Levels, TraceBuildingStrategies" ] }, { @@ -136,7 +136,7 @@ "metadata": {}, "outputs": [], "source": [ - "clip = starfish.image.Filter.Clip(p_max=99.9, expand_dynamic_range=True, is_volume=True)\n", + "clip = starfish.image.Filter.Clip(p_max=99.9, is_volume=True, level_method=Levels.SCALE_BY_CHUNK)\n", "scaled = clip.run(background_corrected, in_place=False)" ] }, diff --git a/notebooks/py/BaristaSeq.py b/notebooks/py/BaristaSeq.py index 114dee2d8..a65963bf7 100644 --- a/notebooks/py/BaristaSeq.py +++ b/notebooks/py/BaristaSeq.py @@ -26,7 +26,7 @@ import starfish import starfish.data -from starfish.types import Axes +from starfish.types import Axes, Levels from starfish.util.plot import ( imshow_plane, intensity_histogram, overlay_spot_calls ) @@ -246,7 +246,7 @@ # EPY: END markdown # EPY: START code -sbp = starfish.image.Filter.Clip(p_max=100, expand_dynamic_range=True) +sbp = starfish.image.Filter.Clip(p_max=100, level_method=Levels.SCALE_BY_CHUNK) scaled = sbp.run(background_corrected, n_processes=1, in_place=False) # EPY: END code @@ -292,7 +292,7 @@ def plot_scaling_result( # EPY: END markdown # EPY: START code -sbp = starfish.image.Filter.Clip(p_max=99.8, expand_dynamic_range=True) +sbp = starfish.image.Filter.Clip(p_max=99.8, level_method=Levels.SCALE_BY_CHUNK) scaled = sbp.run(background_corrected, n_processes=1, in_place=False) f = plot_scaling_result(background_corrected, scaled) diff --git a/notebooks/py/DARTFISH.py b/notebooks/py/DARTFISH.py index f35254772..fa0a5ec68 100644 --- a/notebooks/py/DARTFISH.py +++ b/notebooks/py/DARTFISH.py @@ -22,7 +22,7 @@ from starfish import display from starfish import data, FieldOfView -from starfish.types import Features, Axes +from starfish.types import Axes, Features, Levels from starfish import IntensityTable @@ -80,7 +80,7 @@ # EPY: END markdown # EPY: START code -sc_filt = Filter.Clip(p_max=100, expand_dynamic_range=True) +sc_filt = Filter.Clip(p_max=100, level_method=Levels.SCALE_BY_CHUNK) norm_imgs = sc_filt.run(imgs) # EPY: END code diff --git a/notebooks/py/SeqFISH.py b/notebooks/py/SeqFISH.py index f27a15f63..d360245dc 100644 --- a/notebooks/py/SeqFISH.py +++ b/notebooks/py/SeqFISH.py @@ -23,7 +23,7 @@ import starfish import starfish.data -from starfish.types import Axes, TraceBuildingStrategies +from starfish.types import Axes, Levels, TraceBuildingStrategies # EPY: END code # EPY: START markdown @@ -83,7 +83,7 @@ # EPY: END markdown # EPY: START code -clip = starfish.image.Filter.Clip(p_max=99.9, expand_dynamic_range=True, is_volume=True) +clip = starfish.image.Filter.Clip(p_max=99.9, is_volume=True, level_method=Levels.SCALE_BY_CHUNK) scaled = clip.run(background_corrected, in_place=False) # EPY: END code