Skip to content

Commit 4284f7b

Browse files
authored
Merge pull request #260 from rapidsai/branch-22.04
[RELEASE] cucim v22.04
2 parents 29bfe6f + 73801e6 commit 4284f7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+992
-342
lines changed

.github/ops-bot.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file controls which features from the `ops-bot` repository below are enabled.
2+
# - https://github.com/rapidsai/ops-bot
3+
4+
auto_merger: true
5+
branch_checker: true
6+
label_checker: true
7+
release_drafter: true
8+
external_contributors: false

CHANGELOG.md

Lines changed: 44 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,68 @@
1-
# cuCIM 22.02.00 (2 Feb 2022)
2-
3-
## 🚨 Beaking Changes
4-
5-
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
6-
7-
## 📖 Documentation
8-
9-
- PyPI v21.12.00 elease ([#182](https://github.com/rapidsai/cucim/pull/182)) [@gigony](https://github.com/gigony)
10-
11-
## 🚀 New Featues
12-
13-
- Allow CuPy 10 ([#195](https://github.com/rapidsai/cucim/pull/195)) [@jakikham](https://github.com/jakikham)
14-
- Suppot multi-theads and batch, and suppot nvJPEG fo JPEG-compessed images ([#191](https://github.com/rapidsai/cucim/pull/191)) [@gigony](https://github.com/gigony)
15-
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
16-
17-
## 🛠️ Impovements
18-
19-
- Upgade Numpy to 1.19 fo Python 3.9 suppot ([#203](https://github.com/rapidsai/cucim/pull/203)) [@Ethyling](https://github.com/Ethyling)
20-
- Allow installation with CuPy 10 ([#197](https://github.com/rapidsai/cucim/pull/197)) [@glee77](https://github.com/glee77)
21-
- Upgade Numpy to 1.18 fo Python 3.9 suppot ([#196](https://github.com/rapidsai/cucim/pull/196)) [@Ethyling](https://github.com/Ethyling)
22-
- Add missing impots tests ([#183](https://github.com/rapidsai/cucim/pull/183)) [@Ethyling](https://github.com/Ethyling)
23-
24-
# cuCIM 21.12.00 (9 Dec 2021)
25-
26-
## 🚀 New Features
27-
28-
1. Support Aperio SVS with CPU LZW and jpeg2k decoder ([#141](https://github.com/rapidsai/cucim/pull/141)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
29-
2. Add NVTX support for performance analysis ([#144](https://github.com/rapidsai/cucim/pull/144)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
30-
3. Normalize operation ([#150](https://github.com/rapidsai/cucim/pull/150)) [[@shekhardw](https://github.com/shekhardw)](https://github.com/shekhardw](https://github.com/shekhardw))
31-
32-
### 1. Support Aperio SVS (.svs)
33-
34-
cuCIM now supports [Aperio SVS format](https://openslide.org/formats/aperio/) with help of [OpenJpeg](https://www.openjpeg.org/) for decoding jpeg2k-compressed data.
35-
36-
Please check [this notebook](https://nbviewer.org/github/rapidsai/cucim/blob/branch-21.12/notebooks/Supporting_Aperio_SVS_Format.ipynb) to see how to use the feature.
1+
# cuCIM 22.04.00 (6 Apr 2022)
372

38-
#### Unaligned Case (`per_process`, JPEG-compressed SVS file)
3+
## 🚨 Breaking Changes
394

40-
![image](https://user-images.githubusercontent.com/1928522/141350490-06fdd8cb-5be2-42e4-9774-c7b76fab6f9a.png)
5+
- Apply fixes to skimage.transform scheduled for scikit-image 0.19.2 ([#208](https://github.com/rapidsai/cucim/pull/208)) [@grlee77](https://github.com/grlee77)
416

42-
#### Unaligned Case (`per_process`, JPEG2000 RGB-compressed SVS file)
43-
44-
![image](https://user-images.githubusercontent.com/1928522/141093324-574b532e-ad42-4d61-8473-4c3e07e3feae.png)
45-
46-
#### Unaligned Case (`per_process`, JPEG2000 YCbCr-compressed SVS file)
47-
48-
![image](https://user-images.githubusercontent.com/1928522/141093381-8ab0161d-1b17-4e80-a680-86abfbf2fa65.png)
49-
50-
The detailed data is available [here](https://docs.google.com/spreadsheets/d/15D1EqNI_E9x_S8i3kJLwBxMcEmwk8SafW0WryMrAm6A/edit#gid=369408723).
51-
52-
### 2. Add NVTX support for performance analysis
53-
54-
Important methods in cuCIM are instrumented with [NVTX](https://docs.nvidia.com/gameworks/index.html#gameworkslibrary/nvtx/nvidia_tools_extension_library_nvtx.htm) so can see performance bottlenecks easily with [NSight systems](https://developer.nvidia.com/nsight-systems).
55-
56-
Tracing can be enabled through config file or environment variable or through API and less than 1% performance overheads in normal execution.
7+
## 🐛 Bug Fixes
578

58-
#### Enabling Tracing
59-
##### Through `.cucim.json` file
9+
- Fix ImportError from vendored code ([#252](https://github.com/rapidsai/cucim/pull/252)) [@grlee77](https://github.com/grlee77)
10+
- Fix wrong dimension in metadata ([#248](https://github.com/rapidsai/cucim/pull/248)) [@gigony](https://github.com/gigony)
11+
- Handle file descriptor ownership and update documents for GDS ([#234](https://github.com/rapidsai/cucim/pull/234)) [@gigony](https://github.com/gigony)
12+
- Check nullptr of handler in CuFileDriver::close() ([#229](https://github.com/rapidsai/cucim/pull/229)) [@gigony](https://github.com/gigony)
13+
- Fix docs builds ([#218](https://github.com/rapidsai/cucim/pull/218)) [@ajschmidt8](https://github.com/ajschmidt8)
14+
- Apply fixes to skimage.transform scheduled for scikit-image 0.19.2 ([#208](https://github.com/rapidsai/cucim/pull/208)) [@grlee77](https://github.com/grlee77)
6015

61-
```json
62-
{
63-
"profiler" : { "trace": true }
64-
}
65-
```
16+
## 📖 Documentation
6617

67-
##### Through Environment variable
18+
- Update PyPI cuCIM v22.02.01 CHANGELOG.md ([#249](https://github.com/rapidsai/cucim/pull/249)) [@gigony](https://github.com/gigony)
19+
- Update GTC 2021 Spring video links ([#227](https://github.com/rapidsai/cucim/pull/227)) [@gigony](https://github.com/gigony)
20+
- Update documents for v22.02.00 ([#226](https://github.com/rapidsai/cucim/pull/226)) [@gigony](https://github.com/gigony)
21+
- Merge branch-22.02 into branch-22.04 ([#220](https://github.com/rapidsai/cucim/pull/220)) [@jakirkham](https://github.com/jakirkham)
6822

69-
```bash
70-
CUCIM_TRACE=1 python
71-
```
23+
## 🛠️ Improvements
7224

73-
##### Through API
25+
- Expose data type of CuImage object for interoperability with NumPy ([#246](https://github.com/rapidsai/cucim/pull/246)) [@gigony](https://github.com/gigony)
26+
- Temporarily disable new `ops-bot` functionality ([#239](https://github.com/rapidsai/cucim/pull/239)) [@ajschmidt8](https://github.com/ajschmidt8)
27+
- Add `.github/ops-bot.yaml` config file ([#236](https://github.com/rapidsai/cucim/pull/236)) [@ajschmidt8](https://github.com/ajschmidt8)
28+
- randomization per image per batch ([#231](https://github.com/rapidsai/cucim/pull/231)) [@shekhardw](https://github.com/shekhardw)
7429

75-
```python
76-
from cucim import CuImage
30+
# cuCIM 22.02.00 (2 Feb 2022)
7731

78-
CuImage.profiler(trace=True)
79-
#or
80-
CuImage.profiler().trace(True)
32+
## 🚨 Breaking Changes
8133

82-
CuImage.profiler().config
83-
# {'trace': True}
84-
CuImage.profiler().trace()
85-
# True
86-
CuImage.is_trace_enabled # this is simpler method.
87-
# True
88-
```
34+
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
8935

90-
#### Profiling with NVIDIA Nsight Systems
36+
## 🐛 Bug Fixes
9137

92-
```bash
93-
nsys profile -f true -t cuda,nvtx,osrt -s cpu -x true --trace-fork-before-exec true -o my_profile `which python` benchmark.py
94-
# can add `--stats true`
95-
```
38+
- Fix a bug in [v21.12.01](https://github.com/rapidsai/cucim/wiki/release_notes_v21.12.01) ([#191](https://github.com/rapidsai/cucim/pull/191)) [@gigony](https://github.com/gigony)
39+
- Fix GPU memory leak when using nvJPEG API (when `device='cuda'` parameter is used in `read_region` method).
40+
- Fix segfault for preferred_memory_capacity in Python 3.9+ ([#214](https://github.com/rapidsai/cucim/pull/214)) [@gigony](https://github.com/gigony)
9641

97-
Then, execute `nsight-sys` to open the profile results (my_profile.qdrep).
42+
## 📖 Documentation
9843

99-
![image](https://user-images.githubusercontent.com/1928522/141221297-2ff5224b-e99b-4fe6-af7d-69452141d71d.png)
44+
- PyPI v21.12.00 release ([#182](https://github.com/rapidsai/cucim/pull/182)) [@gigony](https://github.com/gigony)
10045

101-
With this feature, a bug in cuCIM [v21.10.01](https://github.com/rapidsai/cucim/wiki/release_notes_v21.10.01) (thread contention in Cache) was found and fixed ([#145](https://github.com/rapidsai/cucim/pull/145)).
46+
## 🚀 New Features
10247

103-
### 3. Normalize operation
48+
- Update cucim.skimage API to match scikit-image 0.19 ([#190](https://github.com/rapidsai/cucim/pull/190)) [@glee77](https://github.com/glee77)
49+
- Support multi-threads and batch, and support nvJPEG for JPEG-compressed images ([#191](https://github.com/rapidsai/cucim/pull/191)) [@gigony](https://github.com/gigony)
50+
- Allow CuPy 10 ([#195](https://github.com/rapidsai/cucim/pull/195)) [@jakikham](https://github.com/jakikham)
10451

105-
CUDA-based normalization operation is added. Normalization supports the following types.
52+
## 🛠️ Improvements
10653

107-
1. Simple range based normalization
108-
2. Arctangent based normalization
54+
- Add missing imports tests ([#183](https://github.com/rapidsai/cucim/pull/183)) [@Ethyling](https://github.com/Ethyling)
55+
- Allow installation with CuPy 10 ([#197](https://github.com/rapidsai/cucim/pull/197)) [@glee77](https://github.com/glee77)
56+
- Upgrade Numpy to 1.18 for Python 3.9 support ([#196](https://github.com/rapidsai/cucim/pull/196)) [@Ethyling](https://github.com/Ethyling)
57+
- Upgrade Numpy to 1.19 for Python 3.9 support ([#203](https://github.com/rapidsai/cucim/pull/203)) [@Ethyling](https://github.com/Ethyling)
10958

110-
Arctangent-based normalization helps to stretch lower intensity pixels in the image slightly better than range-based normalization. If you look at its [graph](https://mathworld.wolfram.com/InverseTangent.html), there is a huge variation at certain lower intensities, but as intensities become higher, the curve becomes flatter. This helps in isolating regions like lungs (and regions within lungs) more efficiently. There can be separate use cases depending on the modality and the application.
59+
# cuCIM 21.12.00 (9 Dec 2021)
11160

112-
Please check the [test cases](https://github.com/rapidsai/cucim/blob/branch-21.12/python/cucim/src/cucim/core/operations/intensity/tests/test_normalize.py) to see how you can use the operation.
61+
## 🚀 New Features
11362

63+
- Support Aperio SVS with CPU LZW and jpeg2k decoder ([#141](https://github.com/rapidsai/cucim/pull/141)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
64+
- Add NVTX support for performance analysis ([#144](https://github.com/rapidsai/cucim/pull/144)) [[@gigony](https://github.com/gigony)](https://github.com/gigony](https://github.com/gigony))
65+
- Normalize operation ([#150](https://github.com/rapidsai/cucim/pull/150)) [[@shekhardw](https://github.com/shekhardw)](https://github.com/shekhardw](https://github.com/shekhardw))
11466

11567
## 🐛 Bug Fixes
11668

@@ -203,4 +155,4 @@ Please check the [test cases](https://github.com/rapidsai/cucim/blob/branch-21.1
203155

204156
# cuCIM 0.19.0 (15 Apr 2021)
205157

206-
Initial release of cuCIM including cuClaraImage and [cupyimg](https://github.com/mritools/cupyimg).
158+
- Initial release of cuCIM including cuClaraImage and [cupyimg](https://github.com/mritools/cupyimg).

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/cucim/blob/main/README.md) ensure you are on the `main` branch.
77

8-
- [GTC 2021 cuCIM: A GPU Image I/O and Processing Toolkit [S32194]](https://www.nvidia.com/en-us/gtc/catalog/?search=cuCIM#/)
9-
- [video](https://gtc21.event.nvidia.com/media/cuCIM%3A%20A%20GPU%20Image%20I_O%20and%20Processing%20Toolkit%20%5BS32194%5D/1_fwfxd0iu)
8+
- [GTC 2021 cuCIM: A GPU Image I/O and Processing Toolkit [S32194]](https://www.nvidia.com/en-us/on-demand/search/?facet.mimetype[]=event%20session&layout=list&page=1&q=cucim&sort=date)
9+
- [video](https://www.nvidia.com/en-us/on-demand/session/gtcspring21-s32194/)
1010
- [SciPy 2021 cuCIM - A GPU image I/O and processing library](https://www.scipy2021.scipy.org/)
1111
- [video](https://youtu.be/G46kOOM9xbQ)
1212

@@ -39,7 +39,7 @@ pip install scipy scikit-image cupy-cuda110
3939

4040
### Notebooks
4141

42-
Please check out our [Welcome](notebooks/Welcome.ipynb) notebook ([NBViewer](https://nbviewer.jupyter.org/github/rapidsai/cucim/blob/branch-22.02/notebooks/Welcome.ipynb))
42+
Please check out our [Welcome](notebooks/Welcome.ipynb) notebook ([NBViewer](https://nbviewer.jupyter.org/github/rapidsai/cucim/blob/branch-22.04/notebooks/Welcome.ipynb))
4343

4444
#### Downloading sample images
4545

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.02.00
1+
22.04.00

cpp/include/cucim/cuimage.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
2+
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,6 +37,14 @@
3737
#include <string>
3838
#include <vector>
3939

40+
41+
// Forward declarations for DLDataType's equality operator.
42+
template <>
43+
struct std::hash<DLDataType>;
44+
45+
EXPORT_VISIBLE bool operator==(const DLDataType& lhs, const DLDataType& rhs);
46+
EXPORT_VISIBLE bool operator!=(const DLDataType& lhs, const DLDataType& rhs);
47+
4048
namespace cucim
4149
{
4250

@@ -148,6 +156,8 @@ class EXPORT_VISIBLE CuImage : public std::enable_shared_from_this<CuImage>
148156

149157
DLDataType dtype() const;
150158

159+
std::string typestr() const;
160+
151161
std::vector<std::string> channel_names() const;
152162

153163
std::vector<float> spacing(std::string dim_order = std::string{}) const;

cpp/include/cucim/filesystem/cufile_driver.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
2+
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -183,6 +183,9 @@ class EXPORT_VISIBLE CuFileDriver : public std::enable_shared_from_this<CuFileDr
183183

184184
~CuFileDriver();
185185

186+
// To allow 'handle_' field
187+
friend std::shared_ptr<CuFileDriver> open(const char* file_path, const char* flags, mode_t mode);
188+
186189
private:
187190
static Mutex driver_mutex_; // TODO: not used yet.
188191

cpp/include/cucim/filesystem/file_handle.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, NVIDIA CORPORATION.
2+
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,9 @@
1919

2020

2121
#include "../macros/defines.h"
22+
23+
#include <unistd.h>
24+
2225
#include <cstdio>
2326
#include <cstdint>
2427
#include <memory>
@@ -32,7 +35,7 @@ typedef void* CuCIMFileHandle_share;
3235
typedef void* CuCIMFileHandle_ptr;
3336
typedef bool (*CuCIMFileHandleDeleter)(CuCIMFileHandle_ptr);
3437

35-
enum class FileHandleType: uint16_t
38+
enum class FileHandleType : uint16_t
3639
{
3740
kUnknown = 0,
3841
kPosix = 1,
@@ -55,7 +58,8 @@ struct EXPORT_VISIBLE CuCIMFileHandle : public std::enable_shared_from_this<CuCI
5558
void* client_data,
5659
uint64_t dev,
5760
uint64_t ino,
58-
int64_t mtime);
61+
int64_t mtime,
62+
bool own_fd);
5963

6064
~CuCIMFileHandle()
6165
{
@@ -70,6 +74,13 @@ struct EXPORT_VISIBLE CuCIMFileHandle : public std::enable_shared_from_this<CuCI
7074
deleter(this);
7175
deleter = nullptr;
7276
}
77+
78+
if (own_fd && fd >=0)
79+
{
80+
::close(fd);
81+
fd = -1;
82+
own_fd = false;
83+
}
7384
}
7485

7586
CuCIMFileHandleDeleter set_deleter(CuCIMFileHandleDeleter deleter)
@@ -86,6 +97,7 @@ struct EXPORT_VISIBLE CuCIMFileHandle : public std::enable_shared_from_this<CuCI
8697
uint64_t dev = 0;
8798
uint64_t ino = 0;
8899
int64_t mtime = 0;
100+
bool own_fd = false; /// whether if the file descriptor is created internally by the driver
89101
CuCIMFileHandleDeleter deleter = nullptr;
90102
};
91103
#else

0 commit comments

Comments
 (0)