Skip to content

Instantly share code, notes, and snippets.

@mkitti
Created November 4, 2021 21:47
Show Gist options
  • Save mkitti/03ed820163ee0a0595d763d358e82a1f to your computer and use it in GitHub Desktop.
Save mkitti/03ed820163ee0a0595d763d358e82a1f to your computer and use it in GitHub Desktop.
open_ims_from_julia.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "excess-omega",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Julia Version 1.6.3\n",
"Commit ae8452a9e0 (2021-09-23 17:34 UTC)\n",
"Platform Info:\n",
" OS: Windows (x86_64-w64-mingw32)\n",
" CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\n",
" WORD_SIZE: 64\n",
" LIBM: libopenlibm\n",
" LLVM: libLLVM-11.0.1 (ORCJIT, skylake)\n"
]
}
],
"source": [
"versioninfo()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "initial-arrow",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Activating\u001b[22m\u001b[39m environment at `C:\\Users\\kittisopikulm\\Documents\\Keller_Lab\\HDF5Demo\\Project.toml`\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Status\u001b[22m\u001b[39m `C:\\Users\\kittisopikulm\\Documents\\Keller_Lab\\HDF5Demo\\Project.toml` (empty project)\n"
]
}
],
"source": [
"using Pkg\n",
"Pkg.activate(\"HDF5Demo\")\n",
"Pkg.status()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "sunrise-component",
"metadata": {},
"outputs": [],
"source": [
"# For testing\n",
"#Pkg.rm([\"HDF5\",\"HDF5Plugins\"])"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "champion-calcium",
"metadata": {},
"outputs": [],
"source": [
"try\n",
" using HDF5\n",
" using HDF5Plugins\n",
"catch err\n",
" Pkg.add([\"HDF5\", \"HDF5Plugins\"])\n",
" using HDF5\n",
" using HDF5Plugins\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "published-norway",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"C:\\\\Users\\\\kittisopikulm\\\\.julia\\\\dev\\\\HDF5\\\\out_0.ims\""
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"imsfile = raw\"C:\\Users\\kittisopikulm\\.julia\\dev\\HDF5\\out_0.ims\" # From ImarisWriterTest"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "pediatric-saver",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"🗂️ HDF5.File: (read-only) C:\\Users\\kittisopikulm\\.julia\\dev\\HDF5\\out_0.ims\n",
"├─ 🏷️ DataSetDirectoryName\n",
"├─ 🏷️ DataSetInfoDirectoryName\n",
"├─ 🏷️ ImarisDataSet\n",
"├─ 🏷️ ImarisVersion\n",
"├─ 🏷️ NumberOfDataSets\n",
"├─ 🏷️ ThumbnailDirectoryName\n",
"├─ 📂 DataSet\n",
"│ ├─ 📂 ResolutionLevel 0\n",
"│ │ ├─ 📂 TimePoint 0\n",
"│ │ │ ├─ 📂 Channel 0\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ ├─ 📂 Channel 1\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ ├─ 📂 Channel 2\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ └─ 📂 Channel 3\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ └─ 📂 TimePoint 1\n",
"│ │ ├─ 📂 Channel 0\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 1\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 2\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ └─ 📂 Channel 3\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ ├─ 📂 ResolutionLevel 1\n",
"│ │ ├─ 📂 TimePoint 0\n",
"│ │ │ ├─ 📂 Channel 0\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ ├─ 📂 Channel 1\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ ├─ 📂 Channel 2\n",
"│ │ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ │ ├─ 🔢 Data\n",
"│ │ │ │ └─ 🔢 Histogram\n",
"│ │ │ └─ 📂 Channel 3\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ └─ 📂 TimePoint 1\n",
"│ │ ├─ 📂 Channel 0\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 1\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 2\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ └─ 📂 Channel 3\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ └─ 📂 ResolutionLevel 2\n",
"│ ├─ 📂 TimePoint 0\n",
"│ │ ├─ 📂 Channel 0\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 1\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ ├─ 📂 Channel 2\n",
"│ │ │ ├─ 🏷️ HistogramMax\n",
"│ │ │ ├─ 🏷️ HistogramMin\n",
"│ │ │ ├─ 🏷️ ImageSizeX\n",
"│ │ │ ├─ 🏷️ ImageSizeY\n",
"│ │ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ │ ├─ 🔢 Data\n",
"│ │ │ └─ 🔢 Histogram\n",
"│ │ └─ 📂 Channel 3\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ └─ 📂 TimePoint 1\n",
"│ ├─ 📂 Channel 0\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ ├─ 📂 Channel 1\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ ├─ 📂 Channel 2\n",
"│ │ ├─ 🏷️ HistogramMax\n",
"│ │ ├─ 🏷️ HistogramMin\n",
"│ │ ├─ 🏷️ ImageSizeX\n",
"│ │ ├─ 🏷️ ImageSizeY\n",
"│ │ ├─ 🏷️ ImageSizeZ\n",
"│ │ ├─ 🔢 Data\n",
"│ │ └─ 🔢 Histogram\n",
"│ └─ 📂 Channel 3\n",
"│ ├─ 🏷️ HistogramMax\n",
"│ ├─ 🏷️ HistogramMin\n",
"│ ├─ 🏷️ ImageSizeX\n",
"│ ├─ 🏷️ ImageSizeY\n",
"│ ├─ 🏷️ ImageSizeZ\n",
"│ ├─ 🔢 Data\n",
"│ └─ 🔢 Histogram\n",
"├─ 📂 DataSetInfo\n",
"│ ├─ 📂 Channel 0\n",
"│ │ ├─ 🏷️ Color\n",
"│ │ ├─ 🏷️ ColorMode\n",
"│ │ ├─ 🏷️ ColorOpacity\n",
"│ │ ├─ 🏷️ ColorRange\n",
"│ │ ├─ 🏷️ Description\n",
"│ │ ├─ 🏷️ GammaCorrection\n",
"│ │ └─ 🏷️ Name\n",
"│ ├─ 📂 Channel 1\n",
"│ │ ├─ 🏷️ Color\n",
"│ │ ├─ 🏷️ ColorMode\n",
"│ │ ├─ 🏷️ ColorOpacity\n",
"│ │ ├─ 🏷️ ColorRange\n",
"│ │ ├─ 🏷️ Description\n",
"│ │ ├─ 🏷️ GammaCorrection\n",
"│ │ ├─ 🏷️ LSMEmissionWavelength\n",
"│ │ ├─ 🏷️ Name\n",
"│ │ └─ 🏷️ OtherChannelParameter\n",
"│ ├─ 📂 Channel 2\n",
"│ │ ├─ 🏷️ Color\n",
"│ │ ├─ 🏷️ ColorMode\n",
"│ │ ├─ 🏷️ ColorOpacity\n",
"│ │ ├─ 🏷️ ColorRange\n",
"│ │ ├─ 🏷️ Description\n",
"│ │ ├─ 🏷️ GammaCorrection\n",
"│ │ ├─ 🏷️ LSMEmissionWavelength\n",
"│ │ ├─ 🏷️ Name\n",
"│ │ └─ 🏷️ OtherChannelParameter\n",
"│ ├─ 📂 Channel 3\n",
"│ │ ├─ 🏷️ Color\n",
"│ │ ├─ 🏷️ ColorMode\n",
"│ │ ├─ 🏷️ ColorOpacity\n",
"│ │ ├─ 🏷️ ColorRange\n",
"│ │ ├─ 🏷️ Description\n",
"│ │ ├─ 🏷️ GammaCorrection\n",
"│ │ ├─ 🏷️ LSMEmissionWavelength\n",
"│ │ ├─ 🏷️ Name\n",
"│ │ └─ 🏷️ OtherChannelParameter\n",
"│ ├─ 📂 Channel 4\n",
"│ │ ├─ 🏷️ LSMEmissionWavelength\n",
"│ │ ├─ 🏷️ Name\n",
"│ │ └─ 🏷️ OtherChannelParameter\n",
"│ ├─ 📂 Image\n",
"│ │ ├─ 🏷️ Description\n",
"│ │ ├─ 🏷️ ExtMax0\n",
"│ │ ├─ 🏷️ ExtMax1\n",
"│ │ ├─ 🏷️ ExtMax2\n",
"│ │ ├─ 🏷️ ExtMin0\n",
"│ │ ├─ 🏷️ ExtMin1\n",
"│ │ ├─ 🏷️ ExtMin2\n",
"│ │ ├─ 🏷️ Name\n",
"│ │ ├─ 🏷️ RecordingDate\n",
"│ │ ├─ 🏷️ ResampleDimensionX\n",
"│ │ ├─ 🏷️ ResampleDimensionY\n",
"│ │ ├─ 🏷️ ResampleDimensionZ\n",
"│ │ ├─ 🏷️ Unit\n",
"│ │ ├─ 🏷️ X\n",
"│ │ ├─ 🏷️ Y\n",
"│ │ └─ 🏷️ Z\n",
"│ ├─ 📂 ImarisDataSet\n",
"│ │ ├─ 🏷️ Creator\n",
"│ │ ├─ 🏷️ NumberOfImages\n",
"│ │ └─ 🏷️ Version\n",
"│ ├─ 📂 Log\n",
"│ │ └─ 🏷️ Entries\n",
"│ └─ 📂 TimeInfo\n",
"│ ├─ 🏷️ DatasetTimePoints\n",
"│ ├─ 🏷️ FileTimePoints\n",
"│ ├─ 🏷️ TimePoint1\n",
"│ └─ 🏷️ TimePoint2\n",
"└─ 📂 Thumbnail\n",
" └─ 🔢 Data"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"h5file = h5open(imsfile)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "distinguished-latvia",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"📂 HDF5.Group: /DataSet/ResolutionLevel 0/TimePoint 0/Channel 0 (file: C:\\Users\\kittisopikulm\\.julia\\dev\\HDF5\\out_0.ims)\n",
"├─ 🏷️ HistogramMax\n",
"├─ 🏷️ HistogramMin\n",
"├─ 🏷️ ImageSizeX\n",
"├─ 🏷️ ImageSizeY\n",
"├─ 🏷️ ImageSizeZ\n",
"├─ 🔢 Data\n",
"└─ 🔢 Histogram"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"h5file[\"DataSet\"][\"ResolutionLevel 0\"][\"TimePoint 0\"][\"Channel 0\"]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "gothic-comment",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"HDF5.Group"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"typeof(h5file[\"DataSet\"][\"ResolutionLevel 0\"][\"TimePoint 0\"][\"Channel 0\"])"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "focused-filing",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"🔢 HDF5.Dataset: /DataSet/ResolutionLevel 0/TimePoint 0/Channel 0/Data (file: C:\\Users\\kittisopikulm\\.julia\\dev\\HDF5\\out_0.ims xfer_mode: 0)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = h5file[\"DataSet\"][\"ResolutionLevel 0\"][\"TimePoint 0\"][\"Channel 0\"][\"Data\"]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "dominant-fetish",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ndims(d)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "optional-nursing",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(512, 512, 32)"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(d)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "nearby-karen",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"512×512×32 Array{UInt8, 3}:\n",
"[:, :, 1] =\n",
" 0x00 0x00 0x00 0x00 0x00 0x00 … 0x00 0x00 0x00 0x00 0x00 0x00\n",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09\n",
" 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a … 0x0a 0x0a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",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09\n",
" 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a … 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a\n",
" 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b\n",
" 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c\n",
" ⋮ ⋮ ⋱ ⋮ \n",
" 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4 … 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4\n",
" 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5\n",
" 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6\n",
" 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7\n",
" 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8\n",
" 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9 … 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9\n",
" 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa\n",
" 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb\n",
" 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc\n",
" 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd\n",
" 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe … 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe\n",
" 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff\n",
"\n",
"[:, :, 3] =\n",
" 0x00 0x00 0x00 0x00 0x00 0x00 … 0x00 0x00 0x00 0x00 0x00 0x00\n",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09\n",
" 0x0a 0x0a 0x0a 0x0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00 0x00 … 0x00 0x00 0x00 0x00 0x00 0x00\n",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09\n",
" 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a … 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a\n",
" 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b\n",
" 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c\n",
" ⋮ ⋮ ⋱ ⋮ \n",
" 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4 … 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4\n",
" 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5\n",
" 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6\n",
" 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7\n",
" 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8\n",
" 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9 … 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9\n",
" 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa\n",
" 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb\n",
" 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc\n",
" 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd\n",
" 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe … 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe\n",
" 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff\n",
"\n",
"[:, :, 31] =\n",
" 0x00 0x00 0x00 0x00 0x00 0x00 … 0x00 0x00 0x00 0x00 0x00 0x00\n",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x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",
" 0x00 0x00 0x00 0x00 0x00 0x00 … 0x00 0x00 0x00 0x00 0x00 0x00\n",
" 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01\n",
" 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02\n",
" 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03\n",
" 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04 0x04\n",
" 0x05 0x05 0x05 0x05 0x05 0x05 … 0x05 0x05 0x05 0x05 0x05 0x05\n",
" 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06 0x06\n",
" 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07 0x07\n",
" 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08 0x08\n",
" 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09\n",
" 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a … 0x0a 0x0a 0x0a 0x0a 0x0a 0x0a\n",
" 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b 0x0b\n",
" 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c 0x0c\n",
" ⋮ ⋮ ⋱ ⋮ \n",
" 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4 … 0xf4 0xf4 0xf4 0xf4 0xf4 0xf4\n",
" 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5 0xf5\n",
" 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6 0xf6\n",
" 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7 0xf7\n",
" 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8 0xf8\n",
" 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9 … 0xf9 0xf9 0xf9 0xf9 0xf9 0xf9\n",
" 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa 0xfa\n",
" 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb 0xfb\n",
" 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc 0xfc\n",
" 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd\n",
" 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe … 0xfe 0xfe 0xfe 0xfe 0xfe 0xfe\n",
" 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"read(d)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "ongoing-genius",
"metadata": {},
"outputs": [],
"source": [
"name = zeros(Cchar, 64);\n",
"HDF5.h5p_get_filter( HDF5.h5d_get_create_plist(d), 0, Ref{Cuint}(1), Ref{Csize_t}(0), Ref{Cuint}(), 64, pointer(name), Ref{Cuint}())"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "balanced-plenty",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"HDF5 lz4 filter; see http://www.hdfgroup.org/services/contribut\""
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"unsafe_string(pointer(name))"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "divided-burlington",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"HDF5.ChunkStorage{IndexCartesian,3}\n",
"Axes: (1:256:257, 1:256:257, 1:16:17)\n",
"HDF5.Dataset: /DataSet/ResolutionLevel 0/TimePoint 0/Channel 0/Data (file: C:\\Users\\kittisopikulm\\.julia\\dev\\HDF5\\out_0.ims xfer_mode: 0)"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dcs = HDF5.ChunkStorage(d)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "intermediate-prophet",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0x00000000, UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10 … 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dcs[1,1,1]"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "norman-denial",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1048576,)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(dcs[1,1,1][2])"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "wooden-ocean",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1048576"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"uncompressed_block_size = reinterpret(Int64,reverse(dcs[1,1,1][2][1:8]))[1]"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "hundred-yellow",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4377"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"block_size = reinterpret(Int32,reverse(dcs[1,1,1][2][13:16]))[1] "
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "basic-abortion",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4377-element Vector{UInt8}:\n",
" 0xff\n",
" 0xf1\n",
" 0x00\n",
" 0x01\n",
" 0x02\n",
" 0x03\n",
" 0x04\n",
" 0x05\n",
" 0x06\n",
" 0x07\n",
" 0x08\n",
" 0x09\n",
" 0x0a\n",
" ⋮\n",
" 0xff\n",
" 0xff\n",
" 0xff\n",
" 0xff\n",
" 0xff\n",
" 0xf6\n",
" 0x50\n",
" 0xfb\n",
" 0xfc\n",
" 0xfd\n",
" 0xfe\n",
" 0xff"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compressed_data = dcs[1,1,1][2][ (1:block_size) .+ 16 ]"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "bored-genealogy",
"metadata": {},
"outputs": [],
"source": [
"using CodecLz4"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "wound-screening",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1048576-element Vector{UInt8}:\n",
" 0x00\n",
" 0x01\n",
" 0x02\n",
" 0x03\n",
" 0x04\n",
" 0x05\n",
" 0x06\n",
" 0x07\n",
" 0x08\n",
" 0x09\n",
" 0x0a\n",
" 0x0b\n",
" 0x0c\n",
" ⋮\n",
" 0xf4\n",
" 0xf5\n",
" 0xf6\n",
" 0xf7\n",
" 0xf8\n",
" 0xf9\n",
" 0xfa\n",
" 0xfb\n",
" 0xfc\n",
" 0xfd\n",
" 0xfe\n",
" 0xff"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"CodecLz4.lz4_decompress(compressed_data, uncompressed_block_size)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "interracial-trash",
"metadata": {},
"outputs": [],
"source": [
"close(d)\n",
"close(h5file)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "suspected-interference",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"C:\\\\Users\\\\kittisopikulm\\\\Documents\\\\eclipse-workspace\\\\dcimg4j\\\\_shuffle_lz4_no_downsample.ims\""
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 16-bit \n",
"imsfile2 = raw\"C:\\Users\\kittisopikulm\\Documents\\eclipse-workspace\\dcimg4j\\_shuffle_lz4_no_downsample.ims\""
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "developed-peter",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"🔢 HDF5.Dataset: /DataSet/ResolutionLevel 0/TimePoint 2/Channel 0/Data (file: C:\\Users\\kittisopikulm\\Documents\\eclipse-workspace\\dcimg4j\\_shuffle_lz4_no_downsample.ims xfer_mode: 0)"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"name = zeros(Cchar, 64);\n",
"f2 = h5open(imsfile2)\n",
"d2 = f2[\"DataSet\"][\"ResolutionLevel 0\"][\"TimePoint 2\"][\"Channel 0\"][\"Data\"]"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "female-force",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"shuffle\""
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter_idx = 0\n",
"HDF5.h5p_get_filter( HDF5.h5d_get_create_plist(d2), filter_idx, Ref{Cuint}(1), Ref{Csize_t}(0), Ref{Cuint}(), 64, pointer(name), Ref{Cuint}())\n",
"unsafe_string(pointer(name))"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "simplified-miracle",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"HDF5 lz4 filter; see http://www.hdfgroup.org/services/contribut\""
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter_idx = 1\n",
"HDF5.h5p_get_filter( HDF5.h5d_get_create_plist(d2), filter_idx, Ref{Cuint}(1), Ref{Csize_t}(0), Ref{Cuint}(), 64, pointer(name), Ref{Cuint}())\n",
"unsafe_string(pointer(name))"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "senior-celtic",
"metadata": {},
"outputs": [],
"source": [
"close(d2)\n",
"close(f2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "valid-malta",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.6.3 1.6.3",
"language": "julia",
"name": "julia-1.6.3-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment