当前位置:网站首页>[scientific research notes] about using the downsampling multiple of openslide cut
[scientific research notes] about using the downsampling multiple of openslide cut
2022-06-22 04:48:00 【The growth of carp King】
【 Research Notes 】 About use openslide The downsampling multiple of the tangent graph
background
Medical images are huge , We call the whole picture WSI, That is to say whole slide image. We can't use such a large graph in actual processing , So we usually use small ones patch, these patch It is cut from the original picture .
For the convenience of narration , We assume that there is a (h, w) Big picture of .
level What is it?
When cutting a picture, we first involve a level The problem of . If it is level 0, So let's go straight to this (h, w) On the picture of . If it is level 1, So we are (h/downsample_factor, w/downsample_factor) This graph cuts up , In other words, the big picture was first reduced . If it is level 2, The size of the graph becomes [h/(downsample_factor^2), w/(downsample_factor^2)], That is to say, it is further reduced . That is to say, the graph will be adjusted to [h/(downsample_factor^level), w/(downsample_factor^level)].
Okay , that level and downsample_factor What is the relationship ? We might as well look at . Reading medical images generally uses openslide This package , The code is as follows .
slide = openslide.open_slide(str(filename))
slide Is an instantiated object , Let's take a look at its properties slide.level_downsamples. This is actually a list , In this example , The list is [1.0, 4.0, 16.0, …], in other words , This is the difference level Down sampling multiples .level=0 When ,downsample_factor yes 1.0,level=1 When ,downsample_factor yes 4.0. Yes, of course , In different situations , The numbers in this list are not necessarily the same , We should make a concrete analysis according to the specific situation , And use slide.level_downsamples Check to confirm .
Tangent process
Take the first step and zoom in , Then cut the picture . We can set patch Size , such as 256, So all the pictures we cut out are 256*256. If we want to overlap, Then adjust the step size , For example, when there is no overlap, the step length and patch equally , Follow the example just now , That's it 256 Step size of . When it's all done , I want to have a look resize, That is to say, in the end, we should patch Zoom to how big .
preservation
Because there are coordinates in the picture name , So we have to know exactly what this coordinate is . In general , We can find the part of the coordinate definition .
row_cords = np.arange(0, w, args.stride * downsample_factor)
col_cords = np.arange(0, h, args.stride * downsample_factor)
It's not hard to see. , The coordinates are the original coordinates , Without any scaling , We should use appropriate coordinates according to our own needs .
边栏推荐
- slurm 使用教程
- 10道不得不会的 Redis 面试题
- Code example of map and entity class Interoperation
- ORA-15063: ASM discovered an insufficient number of disks for diskgroup 恢複---惜分飛
- tinymce. Init() browser compatibility issue
- Es cannot work, circuitbreakingexception
- Ora - 15063: ASM discovered an insufficient number of Disks for diskgroup Recovery - - -
- 获取DPI函数返回值永远是96 | 获取DPI函数返回值不正确 | GetDpiForMonitor/GetDeviceCaps返回值不正确的原因
- mongo模糊查詢,帶有特殊字符需要轉義,再去查詢
- requests cookie更新值
猜你喜欢

LeetCode——二叉搜索树的第k大节点(借助中序遍历)

Researcher of Shangtang intelligent medical team interprets organ image processing under intelligent medical treatment

基于深度学习的目标检测算法面试必备(RCNN~YOLOv5)

获取DPI函数返回值永远是96 | 获取DPI函数返回值不正确 | GetDpiForMonitor/GetDeviceCaps返回值不正确的原因

Interaction between C language and Lua (practice 2)

After the active RM machine is powered off, RM ha switching is normal. However, the cluster resources cannot be viewed on the yarnui, and the application is always in the accepted state.

POSIX semaphore

Get the specified row content in Oracle rownum and row_ number()

PCM data format

Postman document parameterization
随机推荐
ORA-15063: ASM discovered an insufficient number of disks for diskgroup 恢复---惜分飞
Cloud function realizes fuzzy search function
exness:欧洲央行行长拉加德重申计划在7月会议上加息
Is the Guoyuan futures account reliable? How can a novice safely open an account?
JUC - thread interrupt and thread waiting and wakeup (locksupport)
Use putty to configure port mapping to realize the access of the external network to the server
How much does it cost to buy a fixed-term life insurance with an insured amount of 500000 at the age of 42? Is there any product recommendation
"O & M youxiaodeng" active directory batch modification user
POSIX shared memory
厉害了!淮北两企业获准使用地理标志产品专用标志
Tencent一面
tinymce. Init() browser compatibility issue
Interaction between C language and Lua (practice 2)
Kotlin project reports an error and lacks coroutinecontext dependency
103.简易聊天室6:使用 Socket 通信
Pourquoi golang ne recommande - t - il pas ceci / self / me / this / _ Ça.
【SDX62】IPA log抓取操作说明
Debugging wechat built-in browser with chrome
MySQL common SQL
Go learning notes