From 8bd97c11293e627f896f8bb0f9c58a48a40fb37b Mon Sep 17 00:00:00 2001 From: daslu Date: Thu, 29 Feb 2024 23:36:33 +0200 Subject: [PATCH] - removed the tensor->image function, as it exists in dtype-next now (#14) --- CHANGELOG.md | 3 +++ notebooks/dev.clj | 1 - notebooks/image.clj | 18 ------------------ notebooks/index.clj | 3 +-- src/scicloj/noj/v1/vis/image.clj | 18 ------------------ 5 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 notebooks/image.clj delete mode 100644 src/scicloj/noj/v1/vis/image.clj diff --git a/CHANGELOG.md b/CHANGELOG.md index f572bc9..8cd0d33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). +## [1-alpha28] - unreleased +- removed the tensor->image function, as it exists in dtype-next now (#14) + ## [1-alpha27] - 2024-02-24 - updated metamorph.ml dep diff --git a/notebooks/dev.clj b/notebooks/dev.clj index 4548fec..dd1139e 100644 --- a/notebooks/dev.clj +++ b/notebooks/dev.clj @@ -4,7 +4,6 @@ (clay/make! {:format [:quarto :html] :base-source-path "notebooks" :source-path ["index.clj" - "image.clj" "python.clj" "stats.clj" "visualization.clj" diff --git a/notebooks/image.clj b/notebooks/image.clj deleted file mode 100644 index 8dc2cfd..0000000 --- a/notebooks/image.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns image - (:require [tech.v3.tensor :as tensor] - [tech.v3.datatype.functional :as fun] - [scicloj.noj.v1.vis.image :as vis.image])) - -;; ## Turning tensors into images - -;; The `vis.image/tensor->image` function can help turning [dtype-next](https://github.com/cnuernber/dtype-next/issues/92)'s [tensors](https://cnuernber.github.io/dtype-next/dimensions-bytecode-gen.html) into Java [BufferedImage](https://docs.oracle.com/javase/8/docs/api/java/awt/image/BufferedImage.html) objects. -;; -;; Eventually, this function may find itself in dtype-next itself, see [Issue #92](https://github.com/cnuernber/dtype-next/issues/92) there. -;; -;; You may see this function in action in the [Clay & Noj demo: image processing](https://scicloj.github.io/clojure-data-scrapbook/projects/visual-tools/clay-cider-demo-20231217/index.html) at the [Clojure Data Scrapbook](https://scicloj.github.io/clojure-data-scrapbook/) and in [the related video](https://www.youtube.com/watch?v=fd4kjlws6Ts). - -(-> (for [i (range 100)] - (range 100)) - tensor/ensure-tensor - (fun/* 400) - (vis.image/tensor->image :ushort-gray)) diff --git a/notebooks/index.clj b/notebooks/index.clj index 1335586..e1a6706 100644 --- a/notebooks/index.clj +++ b/notebooks/index.clj @@ -19,8 +19,7 @@ It collects a few of the main dependencies together with functions allowing to c ## Existing chapters ") -(->> ["image" - "python" +(->> ["python" "stats" "visualization" "prepare_for_ml" diff --git a/src/scicloj/noj/v1/vis/image.clj b/src/scicloj/noj/v1/vis/image.clj deleted file mode 100644 index 11633f8..0000000 --- a/src/scicloj/noj/v1/vis/image.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns scicloj.noj.v1.vis.image - (:require - [tech.v3.datatype :as dtype] - [tech.v3.libs.buffered-image :as bimg] - [tech.v3.tensor :as tensor] - [tech.v3.datatype.functional :as fun]) - (:import - javax.imageio.ImageIO - java.awt.image.BufferedImage)) - -(defn tensor->image [tensor img-type] - (let [shape (dtype/shape tensor) - new-img (bimg/new-image (shape 0) - (shape 1) - img-type)] - (dtype/copy! tensor - (tensor/ensure-tensor new-img)) - new-img))