From d4b6fa6b53a3621f2ed89b061636712193e50869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Wed, 6 May 2026 22:43:49 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0.gitignore=E5=92=8C?= =?UTF-8?q?=E6=95=99=E7=A8=8B=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ docs/gridding_simple_tutorial.md | 43 ++++++++++++++++---------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index aeb3680..2a95f7e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ __pycache__/ # OS .DS_Store Thumbs.db + +# Obsidian +.obsidian/ diff --git a/docs/gridding_simple_tutorial.md b/docs/gridding_simple_tutorial.md index caf4882..cb16872 100644 --- a/docs/gridding_simple_tutorial.md +++ b/docs/gridding_simple_tutorial.md @@ -74,13 +74,13 @@ from PIL import Image # 第 23 行 from skimage import color # 第 24 行 ``` -| 第几行 | 导入什么 | 用来干嘛 | -|--------|----------|----------| -| 20 | `os` | 拼接文件路径 `os.path.join(...)` | -| 21 | `numpy` 别名 `np` | 所有数学运算:`np.sum`、`np.max`、`np.array` | -| 22 | `matplotlib.pyplot` 别名 `plt` | 画图、显示图像、划线 | -| 23 | `PIL.Image` | 读取 png 文件 `Image.open(...)` | -| 24 | `skimage.color` | 彩色图转灰度图 `color.rgb2gray(...)` | +| 第几行 | 导入什么 | 用来干嘛 | +| --- | ---------------------------- | ----------------------------------- | +| 20 | `os` | 拼接文件路径 `os.path.join(...)` | +| 21 | `numpy` 别名 `np` | 所有数学运算:`np.sum`、`np.max`、`np.array` | +| 22 | `matplotlib.pyplot` 别名 `plt` | 画图、显示图像、划线 | +| 23 | `PIL.Image` | 读取 png 文件 `Image.open(...)` | +| 24 | `skimage.color` | 彩色图转灰度图 `color.rgb2gray(...)` | --- @@ -110,15 +110,16 @@ OUTPUT_DIR = os.path.join(BASE_DIR, 'results_simple') # 第 33 行 这 4 行在设置**相对路径常量**,保证脚本不管从哪个目录运行都能找到正确的文件。 -| 变量 | 含义 | 示例值 | -|------|------|--------| -| `__file__` | 当前脚本的绝对路径 | `D:/.../src/cDNA_gridding_simple.py` | -| `os.path.abspath(__file__)` | 同上,规范化 | 同上 | -| `os.path.dirname(...)` | 去掉文件名,只留目录 | `D:/.../src` | -| `SCRIPT_DIR` | 脚本所在目录 | `.../src` | -| `BASE_DIR` | 项目根目录(上级) | `.../cDNA微阵列图像处理作业` | -| `DATA_DIR` | 输入图像所在目录 | `.../cDNA图像处理实例/数据/cDNA` | -| `OUTPUT_DIR` | 输出图像保存目录 | `.../results_simple` | +| 变量 | 含义 | 示例值 | +| --------------------------- | ---------- | ------------------------------------ | +| `__file__` | 当前脚本的绝对路径 | `D:/.../src/cDNA_gridding_simple.py` | +| `os.path.abspath(__file__)` | 同上,规范化 | 同上 | +| `os.path.dirname(...)` | 去掉文件名,只留目录 | `D:/.../src` | +| `SCRIPT_DIR` | 脚本所在目录 | `.../src` | +| `BASE_DIR` | 项目根目录(上级) | `.../cDNA微阵列图像处理作业` | +| `DATA_DIR` | 输入图像所在目录 | `.../cDNA图像处理实例/数据/cDNA` | +| `OUTPUT_DIR` | 输出图像保存目录 | `.../results_simple` | +| | | | `os.sep.join(A, B, C)` 会把 A、B、C 用系统的路径分隔符(Windows 是 `\`)拼起来: ``` @@ -507,12 +508,12 @@ Python 的习惯写法。 **算法优点**: -| 维度 | 评价 | -|------|------| -| 理解难度 | 只需初中数学(加减乘除、比较大小) | -| 代码行数 | 核心逻辑不足 30 行 | +| 维度 | 评价 | +| ----- | ----------------- | +| 理解难度 | 只需初中数学(加减乘除、比较大小) | +| 代码行数 | 核心逻辑不足 30 行 | | 与原版精度 | **完全相同(误差 0 像素)** | -| 可调参数 | 仅一个(阈值百分比 10%) | +| 可调参数 | 仅一个(阈值百分比 10%) | **为什么这么简单的方法能这么准?**