Comments (2)
Thanks @aan1173 for the report and sorry for the late response.
For Generic tiled tiff file to be loaded by cuCIM, subfile
type of TIFF is correctly set (only one image with subfile type 0 which is the largest image should be available).
- For the main (largest resolution): subfiletype == 0
- For reduced images: subfiletype == 1
SUBFILETYPE_NONE = 0
SUBFILETYPE_REDUCEDIMAGE = 1
if level: # if this image is reduced image
subfiletype = SUBFILETYPE_REDUCEDIMAGE
else: # if this is the original image (largest image)
subfiletype = SUBFILETYPE_NONE
tif.save(
src_arr,
software="Glencoe/Faas pyramid",
metadata={"axes": "YXC"},
tile=(tile_size, tile_size),
photometric="RGB",
planarconfig="CONTIG",
resolution=(
x_resolution // 2 ** level,
y_resolution // 2 ** level,
resolution_unit,
),
compress=("jpeg", 95), # requires imagecodecs
subfiletype=subfiletype,
)
To convert .svs file to Generic TIFF format, you can use cucim's cli command:
Convert .svs file to .tif file
This package has the CLI tool to convert image in other formats (such as .svs) to TIFF (JPEG-compressed) image by using tifffile library. You can exploit the tool until cuCIM natively supports Aperio SVS format.
Please install openslide-python
, opencv-python
and tifffile
package and follow the instruction here:
$ cucim convert --help
Usage: cucim convert [OPTIONS] SRC_FILE [DEST_FOLDER]
Convert file format
Options:
--tile-size INTEGER
--overlap INTEGER
--num-workers INTEGER
--output-filename TEXT
--help Show this message and exit.
$ cucim convert input/TUPAC-TR-467.svs --output-filename TUPAC-TR-467.tif --tile-size 512
INFO:cucim.clara.converter.tiff:Parameters
INFO:cucim.clara.converter.tiff: input file: input/TUPAC-TR-467.svs
INFO:cucim.clara.converter.tiff: output folder: .
INFO:cucim.clara.converter.tiff: tile size: 512
INFO:cucim.clara.converter.tiff: overlap: 0
INFO:cucim.clara.converter.tiff: num_workers: 12
INFO:cucim.clara.converter.tiff: output filename: TUPAC-TR-467.tif
INFO:cucim.clara.converter.tiff: Created level0.mmap (26420, 19920, 3)
INFO:cucim.clara.converter.tiff: Created level1.mmap (13210, 9960, 3)
INFO:cucim.clara.converter.tiff: Created level2.mmap (6605, 4980, 3)
INFO:cucim.clara.converter.tiff: Created level3.mmap (3302, 2490, 3)
INFO:cucim.clara.converter.tiff: Created level4.mmap (1651, 1245, 3)
INFO:cucim.clara.converter.tiff: Created level5.mmap (826, 622, 3)
INFO:cucim.clara.converter.tiff:Processing tiles...
INFO:cucim.clara.converter.tiff:Storing low resolution images...
INFO:cucim.clara.converter.tiff: Level 1: (13210, 9960, 3)
INFO:cucim.clara.converter.tiff: Level 2: (6605, 4980, 3)
INFO:cucim.clara.converter.tiff: Level 3: (3302, 2490, 3)
INFO:cucim.clara.converter.tiff: Level 4: (1651, 1245, 3)
INFO:cucim.clara.converter.tiff: Level 5: (826, 622, 3)
INFO:cucim.clara.converter.tiff:Saving Level 0 image (19920 x 26420)...
INFO:cucim.clara.converter.tiff:Saving Level 1 image (9960 x 13210)...
INFO:cucim.clara.converter.tiff:Saving Level 2 image (4980 x 6605)...
INFO:cucim.clara.converter.tiff:Saving Level 3 image (2490 x 3302)...
INFO:cucim.clara.converter.tiff:Saving Level 4 image (1245 x 1651)...
INFO:cucim.clara.converter.tiff:Saving Level 5 image (622 x 826)...
INFO:cucim.clara.converter.tiff:Done.
INFO:cucim.clara.converter.tiff:Removing memmapped files...
code for the converter is available in https://github.com/rapidsai/cucim/blob/branch-21.08/python/cucim/src/cucim/clara/converter/tiff.py and it uses this CLI (https://github.com/rapidsai/cucim/blob/branch-21.08/python/cucim/src/cucim/clara/cli.py).
FYI, we are planning to support .svs format for v21.10.01 (#35)
from cucim.
uploaded the Image File(1M09_1.tif) to Google Drive.
https://drive.google.com/file/d/1AZlocYpdRZd9jC0s-JsOtWuxCTZJwdgf/view?usp=sharing
from cucim.
Related Issues (20)
- Cache Notebooks HOT 1
- Cleanup `python/cucim/docs`
- Cleanup `python/cucim/ci`
- Review & cleanup `python/cucim`
- Drop `.cookiecutterrc`
- Drop `.idea`
- Validate wheel on CI
- Test CuPy 12 & 13 on CI
- Devendor CMake dependencies
- Drop Python pre-3.9 logic HOT 4
- Slowness seen using PiecewiseAffineTransform compared to scikit-image version HOT 2
- Enable `libcufile` on `linux_aarch64` (w/CUDA 12.2+) HOT 1
- [BUG] `click` is listed only in test requirements but is a required in order to use `cucim.clara` HOT 2
- Is `cucim.code-workspace` still used? HOT 2
- Add `devcontainer`s HOT 1
- Order of axes for `CuImage.origin`? HOT 4
- [FEA] Enable cuda-version dependency resolution for packages that depend on cucim or other rapids packages HOT 4
- [FEA] CUDA accelerated foolfill algorithm with distance return HOT 2
- [BUG] No module named 'cucim.clara._cucim' HOT 5
- investigate switching KDTree usage from SciPy to CuPy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cucim.