|
66 | 66 | },
|
67 | 67 | {
|
68 | 68 | "cell_type": "code",
|
69 |
| - "execution_count": 1, |
| 69 | + "execution_count": null, |
70 | 70 | "metadata": {
|
71 | 71 | "tags": []
|
72 | 72 | },
|
73 |
| - "outputs": [ |
74 |
| - { |
75 |
| - "name": "stdout", |
76 |
| - "output_type": "stream", |
77 |
| - "text": [ |
78 |
| - "MONAI version: 0.2.0\n", |
79 |
| - "Python version: 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31) [GCC 7.3.0]\n", |
80 |
| - "Numpy version: 1.18.1\n", |
81 |
| - "Pytorch version: 1.6.0\n", |
82 |
| - "\n", |
83 |
| - "Optional dependencies:\n", |
84 |
| - "Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.\n", |
85 |
| - "Nibabel version: 3.1.1\n", |
86 |
| - "scikit-image version: 0.15.0\n", |
87 |
| - "Pillow version: 7.2.0\n", |
88 |
| - "Tensorboard version: 2.1.0\n", |
89 |
| - "\n", |
90 |
| - "For details about installing the optional dependencies, please visit:\n", |
91 |
| - " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n", |
92 |
| - "\n" |
93 |
| - ] |
94 |
| - } |
95 |
| - ], |
| 73 | + "outputs": [], |
96 | 74 | "source": [
|
97 | 75 | "# Copyright 2020 MONAI Consortium\n",
|
98 | 76 | "# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
|
|
133 | 111 | "cell_type": "markdown",
|
134 | 112 | "metadata": {},
|
135 | 113 | "source": [
|
136 |
| - "## Load image with default image reader\n", |
| 114 | + "## Load Nifti image with default image reader\n", |
137 | 115 | "MONAI leverages `ITK` as the default image reader, it can support most of the common medical image formats.\n",
|
138 | 116 | "More details, please check: https://github.com/InsightSoftwareConsortium/ITK/tree/master/Modules/IO"
|
139 | 117 | ]
|
140 | 118 | },
|
141 | 119 | {
|
142 | 120 | "cell_type": "code",
|
143 |
| - "execution_count": 8, |
| 121 | + "execution_count": 2, |
144 | 122 | "metadata": {
|
145 | 123 | "tags": []
|
146 | 124 | },
|
|
149 | 127 | "name": "stdout",
|
150 | 128 | "output_type": "stream",
|
151 | 129 | "text": [
|
152 |
| - "image data shape:(128, 128, 128)\n", |
153 |
| - "meta data:{'ITK_FileNotes': '', 'aux_file': '', 'bitpix': '64', 'cal_max': '0', 'cal_min': '0', 'datatype': '64', 'descrip': '', 'dim[0]': '3', 'dim[1]': '128', 'dim[2]': '128', 'dim[3]': '128', 'dim[4]': '1', 'dim[5]': '1', 'dim[6]': '1', 'dim[7]': '1', 'dim_info': '0', 'intent_code': '0', 'intent_name': '', 'intent_p1': '0', 'intent_p2': '0', 'intent_p3': '0', 'nifti_type': '1', 'pixdim[0]': '0', 'pixdim[1]': '1', 'pixdim[2]': '1', 'pixdim[3]': '1', 'pixdim[4]': '0', 'pixdim[5]': '0', 'pixdim[6]': '0', 'pixdim[7]': '0', 'qform_code': '1', 'qform_code_name': 'NIFTI_XFORM_SCANNER_ANAT', 'qoffset_x': '-0', 'qoffset_y': '-0', 'qoffset_z': '0', 'quatern_b': '0', 'quatern_c': '0', 'quatern_d': '1', 'scl_inter': '0', 'scl_slope': '1', 'sform_code': '0', 'sform_code_name': 'NIFTI_XFORM_UNKNOWN', 'slice_code': '0', 'slice_duration': '0', 'slice_end': '0', 'slice_start': '0', 'srow_x': '0 0 0 0', 'srow_y': '0 0 0 0', 'srow_z': '0 0 0 0', 'toffset': '0', 'vox_offset': '352', 'xyzt_units': '2', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
| 130 | + "image data shape:(64, 128, 96)\n", |
| 131 | + "meta data:{'ITK_FileNotes': '', 'aux_file': '', 'bitpix': '64', 'cal_max': '0', 'cal_min': '0', 'datatype': '64', 'descrip': '', 'dim[0]': '3', 'dim[1]': '96', 'dim[2]': '128', 'dim[3]': '64', 'dim[4]': '1', 'dim[5]': '1', 'dim[6]': '1', 'dim[7]': '1', 'dim_info': '0', 'intent_code': '0', 'intent_name': '', 'intent_p1': '0', 'intent_p2': '0', 'intent_p3': '0', 'nifti_type': '1', 'pixdim[0]': '0', 'pixdim[1]': '1', 'pixdim[2]': '1', 'pixdim[3]': '1', 'pixdim[4]': '0', 'pixdim[5]': '0', 'pixdim[6]': '0', 'pixdim[7]': '0', 'qform_code': '1', 'qform_code_name': 'NIFTI_XFORM_SCANNER_ANAT', 'qoffset_x': '-0', 'qoffset_y': '-0', 'qoffset_z': '0', 'quatern_b': '0', 'quatern_c': '0', 'quatern_d': '1', 'scl_inter': '0', 'scl_slope': '1', 'sform_code': '0', 'sform_code_name': 'NIFTI_XFORM_UNKNOWN', 'slice_code': '0', 'slice_duration': '0', 'slice_end': '0', 'slice_start': '0', 'srow_x': '0 0 0 0', 'srow_y': '0 0 0 0', 'srow_z': '0 0 0 0', 'toffset': '0', 'vox_offset': '352', 'xyzt_units': '2', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
154 | 132 | " [0., 1., 0.],\n",
|
155 | 133 | " [0., 0., 1.]]), 'original_affine': array([[1., 0., 0., 0.],\n",
|
156 | 134 | " [0., 1., 0., 0.],\n",
|
157 | 135 | " [0., 0., 1., 0.],\n",
|
158 | 136 | " [0., 0., 0., 1.]]), 'affine': array([[1., 0., 0., 0.],\n",
|
159 | 137 | " [0., 1., 0., 0.],\n",
|
160 | 138 | " [0., 0., 1., 0.],\n",
|
161 |
| - " [0., 0., 0., 1.]]), 'spatial_shape': [128, 128, 128], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.nii.gz'}\n" |
| 139 | + " [0., 0., 0., 1.]]), 'spatial_shape': [64, 128, 96], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.nii.gz'}\n" |
162 | 140 | ]
|
163 | 141 | }
|
164 | 142 | ],
|
165 | 143 | "source": [
|
166 | 144 | "# generate 3D test images\n",
|
167 | 145 | "tempdir = tempfile.mkdtemp()\n",
|
168 |
| - "test_image = np.random.rand(128, 128, 128)\n", |
| 146 | + "test_image = np.random.rand(64, 128, 96)\n", |
169 | 147 | "filename = os.path.join(tempdir, \"test_image.nii.gz\")\n",
|
170 | 148 | "itk_np_view = itk.image_view_from_array(test_image)\n",
|
171 | 149 | "itk.imwrite(itk_np_view, filename)\n",
|
|
179 | 157 | "cell_type": "markdown",
|
180 | 158 | "metadata": {},
|
181 | 159 | "source": [
|
182 |
| - "## Load a list of images and stack as 1 training item\n", |
| 160 | + "## Load a list of Nifti images and stack as 1 training item\n", |
183 | 161 | "Loading a list of files, stack them together and add a new dimension as first dimension.\n",
|
184 | 162 | "\n",
|
185 | 163 | "And use the meta data of the first image to represent the stacked result."
|
186 | 164 | ]
|
187 | 165 | },
|
188 | 166 | {
|
189 | 167 | "cell_type": "code",
|
190 |
| - "execution_count": 9, |
| 168 | + "execution_count": 3, |
191 | 169 | "metadata": {},
|
192 | 170 | "outputs": [
|
193 | 171 | {
|
194 | 172 | "name": "stdout",
|
195 | 173 | "output_type": "stream",
|
196 | 174 | "text": [
|
197 |
| - "image data shape:(3, 128, 128, 128)\n", |
198 |
| - "meta data:{'ITK_FileNotes': '', 'aux_file': '', 'bitpix': '64', 'cal_max': '0', 'cal_min': '0', 'datatype': '64', 'descrip': '', 'dim[0]': '3', 'dim[1]': '128', 'dim[2]': '128', 'dim[3]': '128', 'dim[4]': '1', 'dim[5]': '1', 'dim[6]': '1', 'dim[7]': '1', 'dim_info': '0', 'intent_code': '0', 'intent_name': '', 'intent_p1': '0', 'intent_p2': '0', 'intent_p3': '0', 'nifti_type': '1', 'pixdim[0]': '0', 'pixdim[1]': '1', 'pixdim[2]': '1', 'pixdim[3]': '1', 'pixdim[4]': '0', 'pixdim[5]': '0', 'pixdim[6]': '0', 'pixdim[7]': '0', 'qform_code': '1', 'qform_code_name': 'NIFTI_XFORM_SCANNER_ANAT', 'qoffset_x': '-0', 'qoffset_y': '-0', 'qoffset_z': '0', 'quatern_b': '0', 'quatern_c': '0', 'quatern_d': '1', 'scl_inter': '0', 'scl_slope': '1', 'sform_code': '0', 'sform_code_name': 'NIFTI_XFORM_UNKNOWN', 'slice_code': '0', 'slice_duration': '0', 'slice_end': '0', 'slice_start': '0', 'srow_x': '0 0 0 0', 'srow_y': '0 0 0 0', 'srow_z': '0 0 0 0', 'toffset': '0', 'vox_offset': '352', 'xyzt_units': '2', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
| 175 | + "image data shape:(3, 64, 128, 96)\n", |
| 176 | + "meta data:{'ITK_FileNotes': '', 'aux_file': '', 'bitpix': '64', 'cal_max': '0', 'cal_min': '0', 'datatype': '64', 'descrip': '', 'dim[0]': '3', 'dim[1]': '96', 'dim[2]': '128', 'dim[3]': '64', 'dim[4]': '1', 'dim[5]': '1', 'dim[6]': '1', 'dim[7]': '1', 'dim_info': '0', 'intent_code': '0', 'intent_name': '', 'intent_p1': '0', 'intent_p2': '0', 'intent_p3': '0', 'nifti_type': '1', 'pixdim[0]': '0', 'pixdim[1]': '1', 'pixdim[2]': '1', 'pixdim[3]': '1', 'pixdim[4]': '0', 'pixdim[5]': '0', 'pixdim[6]': '0', 'pixdim[7]': '0', 'qform_code': '1', 'qform_code_name': 'NIFTI_XFORM_SCANNER_ANAT', 'qoffset_x': '-0', 'qoffset_y': '-0', 'qoffset_z': '0', 'quatern_b': '0', 'quatern_c': '0', 'quatern_d': '1', 'scl_inter': '0', 'scl_slope': '1', 'sform_code': '0', 'sform_code_name': 'NIFTI_XFORM_UNKNOWN', 'slice_code': '0', 'slice_duration': '0', 'slice_end': '0', 'slice_start': '0', 'srow_x': '0 0 0 0', 'srow_y': '0 0 0 0', 'srow_z': '0 0 0 0', 'toffset': '0', 'vox_offset': '352', 'xyzt_units': '2', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
199 | 177 | " [0., 1., 0.],\n",
|
200 | 178 | " [0., 0., 1.]]), 'original_affine': array([[1., 0., 0., 0.],\n",
|
201 | 179 | " [0., 1., 0., 0.],\n",
|
202 | 180 | " [0., 0., 1., 0.],\n",
|
203 | 181 | " [0., 0., 0., 1.]]), 'affine': array([[1., 0., 0., 0.],\n",
|
204 | 182 | " [0., 1., 0., 0.],\n",
|
205 | 183 | " [0., 0., 1., 0.],\n",
|
206 |
| - " [0., 0., 0., 1.]]), 'spatial_shape': [128, 128, 128], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.nii.gz'}\n" |
| 184 | + " [0., 0., 0., 1.]]), 'spatial_shape': [64, 128, 96], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.nii.gz'}\n" |
207 | 185 | ]
|
208 | 186 | }
|
209 | 187 | ],
|
|
219 | 197 | "print(f\"meta data:{meta}\")"
|
220 | 198 | ]
|
221 | 199 | },
|
| 200 | + { |
| 201 | + "cell_type": "markdown", |
| 202 | + "metadata": {}, |
| 203 | + "source": [ |
| 204 | + "## Load 3D image in DICOM format" |
| 205 | + ] |
| 206 | + }, |
| 207 | + { |
| 208 | + "cell_type": "code", |
| 209 | + "execution_count": 4, |
| 210 | + "metadata": {}, |
| 211 | + "outputs": [ |
| 212 | + { |
| 213 | + "name": "stdout", |
| 214 | + "output_type": "stream", |
| 215 | + "text": [ |
| 216 | + "image data shape:(64, 128, 96)\n", |
| 217 | + "meta data:{'0008|0016': '1.2.840.10008.5.1.4.1.1.7.2', '0008|0018': '1.2.826.0.1.3680043.2.1125.1.64732409224407717340688313759116819', '0008|0020': '20200917', '0008|0030': '012951.461675 ', '0008|0050': '', '0008|0060': 'OT', '0008|0090': '', '0010|0010': '', '0010|0020': '', '0010|0030': '', '0010|0040': '', '0020|000d': '1.2.826.0.1.3680043.2.1125.1.22199909824554379284164927198357157', '0020|000e': '1.2.826.0.1.3680043.2.1125.1.64330868579047092348166172965815757', '0020|0010': '', '0020|0011': '', '0020|0013': '', '0020|0052': '1.2.826.0.1.3680043.2.1125.1.36887462277578362563842268362959985', '0028|0002': '1', '0028|0004': 'MONOCHROME2 ', '0028|0008': '64', '0028|0009': '(5200,9230)', '0028|0010': '128', '0028|0011': '96', '0028|0100': '8', '0028|0101': '8', '0028|0102': '7', '0028|0103': '0', '0028|1052': '0 ', '0028|1053': '1 ', '0028|1054': 'US', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
| 218 | + " [0., 1., 0.],\n", |
| 219 | + " [0., 0., 1.]]), 'original_affine': array([[1., 0., 0., 0.],\n", |
| 220 | + " [0., 1., 0., 0.],\n", |
| 221 | + " [0., 0., 1., 0.],\n", |
| 222 | + " [0., 0., 0., 1.]]), 'affine': array([[1., 0., 0., 0.],\n", |
| 223 | + " [0., 1., 0., 0.],\n", |
| 224 | + " [0., 0., 1., 0.],\n", |
| 225 | + " [0., 0., 0., 1.]]), 'spatial_shape': [64, 128, 96], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.dcm'}\n" |
| 226 | + ] |
| 227 | + } |
| 228 | + ], |
| 229 | + "source": [ |
| 230 | + "filename = os.path.join(tempdir, \"test_image.dcm\")\n", |
| 231 | + "dcm_image = np.random.randint(256, size=(64, 128, 96)).astype(np.uint8())\n", |
| 232 | + "itk_np_view = itk.image_view_from_array(dcm_image)\n", |
| 233 | + "itk.imwrite(itk_np_view, filename)\n", |
| 234 | + "data, meta = LoadImage()(filename)\n", |
| 235 | + "\n", |
| 236 | + "print(f\"image data shape:{data.shape}\")\n", |
| 237 | + "print(f\"meta data:{meta}\")" |
| 238 | + ] |
| 239 | + }, |
| 240 | + { |
| 241 | + "cell_type": "markdown", |
| 242 | + "metadata": {}, |
| 243 | + "source": [ |
| 244 | + "## Load a list of DICOM images and stack as 1 training item\n", |
| 245 | + "Loading a list of files, stack them together and add a new dimension as first dimension.\n", |
| 246 | + "\n", |
| 247 | + "And use the meta data of the first image to represent the stacked result." |
| 248 | + ] |
| 249 | + }, |
| 250 | + { |
| 251 | + "cell_type": "code", |
| 252 | + "execution_count": 5, |
| 253 | + "metadata": {}, |
| 254 | + "outputs": [ |
| 255 | + { |
| 256 | + "name": "stdout", |
| 257 | + "output_type": "stream", |
| 258 | + "text": [ |
| 259 | + "image data shape:(3, 64, 128, 96)\n", |
| 260 | + "meta data:{'0008|0016': '1.2.840.10008.5.1.4.1.1.7.2', '0008|0018': '1.2.826.0.1.3680043.2.1125.1.55124182629917658983046437541692429', '0008|0020': '20200917', '0008|0030': '012953.377970 ', '0008|0050': '', '0008|0060': 'OT', '0008|0090': '', '0010|0010': '', '0010|0020': '', '0010|0030': '', '0010|0040': '', '0020|000d': '1.2.826.0.1.3680043.2.1125.1.54570928137383298712421968711546946', '0020|000e': '1.2.826.0.1.3680043.2.1125.1.79105954593572939973262028207196688', '0020|0010': '', '0020|0011': '', '0020|0013': '', '0020|0052': '1.2.826.0.1.3680043.2.1125.1.37569814707528773722727172695078933', '0028|0002': '1', '0028|0004': 'MONOCHROME2 ', '0028|0008': '64', '0028|0009': '(5200,9230)', '0028|0010': '128', '0028|0011': '96', '0028|0100': '8', '0028|0101': '8', '0028|0102': '7', '0028|0103': '0', '0028|1052': '0 ', '0028|1053': '1 ', '0028|1054': 'US', 'origin': array([0., 0., 0.]), 'spacing': array([1., 1., 1.]), 'direction': array([[1., 0., 0.],\n", |
| 261 | + " [0., 1., 0.],\n", |
| 262 | + " [0., 0., 1.]]), 'original_affine': array([[1., 0., 0., 0.],\n", |
| 263 | + " [0., 1., 0., 0.],\n", |
| 264 | + " [0., 0., 1., 0.],\n", |
| 265 | + " [0., 0., 0., 1.]]), 'affine': array([[1., 0., 0., 0.],\n", |
| 266 | + " [0., 1., 0., 0.],\n", |
| 267 | + " [0., 0., 1., 0.],\n", |
| 268 | + " [0., 0., 0., 1.]]), 'spatial_shape': [64, 128, 96], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.dcm'}\n" |
| 269 | + ] |
| 270 | + } |
| 271 | + ], |
| 272 | + "source": [ |
| 273 | + "filenames = [\"test_image.dcm\", \"test_image2.dcm\", \"test_image3.dcm\"]\n", |
| 274 | + "for i, name in enumerate(filenames):\n", |
| 275 | + " filenames[i] = os.path.join(tempdir, name)\n", |
| 276 | + " itk_np_view = itk.image_view_from_array(dcm_image)\n", |
| 277 | + " itk.imwrite(itk_np_view, filenames[i])\n", |
| 278 | + "data, meta = LoadImage()(filenames)\n", |
| 279 | + "\n", |
| 280 | + "print(f\"image data shape:{data.shape}\")\n", |
| 281 | + "print(f\"meta data:{meta}\")" |
| 282 | + ] |
| 283 | + }, |
222 | 284 | {
|
223 | 285 | "cell_type": "markdown",
|
224 | 286 | "metadata": {},
|
|
228 | 290 | },
|
229 | 291 | {
|
230 | 292 | "cell_type": "code",
|
231 |
| - "execution_count": 12, |
| 293 | + "execution_count": 6, |
232 | 294 | "metadata": {
|
233 | 295 | "tags": []
|
234 | 296 | },
|
|
237 | 299 | "name": "stdout",
|
238 | 300 | "output_type": "stream",
|
239 | 301 | "text": [
|
240 |
| - "image data shape:(256, 256)\n", |
| 302 | + "image data shape:(128, 256)\n", |
241 | 303 | "meta data:{'origin': array([0., 0.]), 'spacing': array([1., 1.]), 'direction': array([[1., 0.],\n",
|
242 | 304 | " [0., 1.]]), 'original_affine': array([[1., 0., 0.],\n",
|
243 | 305 | " [0., 1., 0.],\n",
|
244 | 306 | " [0., 0., 1.]]), 'affine': array([[1., 0., 0.],\n",
|
245 | 307 | " [0., 1., 0.],\n",
|
246 |
| - " [0., 0., 1.]]), 'spatial_shape': [256, 256], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.png'}\n" |
| 308 | + " [0., 0., 1.]]), 'spatial_shape': [128, 256], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.png'}\n" |
247 | 309 | ]
|
248 | 310 | }
|
249 | 311 | ],
|
250 | 312 | "source": [
|
251 |
| - "test_image = np.random.randint(0, 256, size=[256, 256])\n", |
| 313 | + "test_image = np.random.randint(0, 256, size=[128, 256])\n", |
252 | 314 | "filename = os.path.join(tempdir, \"test_image.png\")\n",
|
253 | 315 | "Image.fromarray(test_image.astype(\"uint8\")).save(filename)\n",
|
254 | 316 | "data, meta = LoadImage()(filename)\n",
|
|
272 | 334 | },
|
273 | 335 | {
|
274 | 336 | "cell_type": "code",
|
275 |
| - "execution_count": 17, |
| 337 | + "execution_count": 7, |
276 | 338 | "metadata": {},
|
277 | 339 | "outputs": [
|
278 | 340 | {
|
279 | 341 | "name": "stdout",
|
280 | 342 | "output_type": "stream",
|
281 | 343 | "text": [
|
282 |
| - "image data shape:(256, 256)\n", |
| 344 | + "image data shape:(128, 256)\n", |
283 | 345 | "meta data:{'origin': array([0., 0.]), 'spacing': array([1., 1.]), 'direction': array([[1., 0.],\n",
|
284 | 346 | " [0., 1.]]), 'original_affine': array([[1., 0., 0.],\n",
|
285 | 347 | " [0., 1., 0.],\n",
|
286 | 348 | " [0., 0., 1.]]), 'affine': array([[1., 0., 0.],\n",
|
287 | 349 | " [0., 1., 0.],\n",
|
288 |
| - " [0., 0., 1.]]), 'spatial_shape': [256, 256], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.png'}\n" |
| 350 | + " [0., 0., 1.]]), 'spatial_shape': [128, 256], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.png'}\n" |
289 | 351 | ]
|
290 | 352 | }
|
291 | 353 | ],
|
292 | 354 | "source": [
|
293 | 355 | "loader = LoadImage()\n",
|
294 |
| - "loader.register(ITKReader(c_order_axis_indexing=True))\n", |
| 356 | + "loader.register(ITKReader())\n", |
295 | 357 | "data, meta = loader(filename)\n",
|
296 | 358 | "\n",
|
297 | 359 | "print(f\"image data shape:{data.shape}\")\n",
|
|
310 | 372 | },
|
311 | 373 | {
|
312 | 374 | "cell_type": "code",
|
313 |
| - "execution_count": 18, |
| 375 | + "execution_count": 8, |
314 | 376 | "metadata": {},
|
315 | 377 | "outputs": [
|
316 | 378 | {
|
317 | 379 | "name": "stdout",
|
318 | 380 | "output_type": "stream",
|
319 | 381 | "text": [
|
320 |
| - "image data shape:(256, 256, 2)\n", |
321 |
| - "meta data:{'format': None, 'mode': 'LA', 'width': 256, 'height': 256, 'info': {}, 'spatial_shape': [256, 256], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.png'}\n" |
| 382 | + "image data shape:(128, 256, 2)\n", |
| 383 | + "meta data:{'format': None, 'mode': 'LA', 'width': 256, 'height': 128, 'info': {}, 'spatial_shape': [256, 128], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.png'}\n" |
322 | 384 | ]
|
323 | 385 | }
|
324 | 386 | ],
|
|
340 | 402 | },
|
341 | 403 | {
|
342 | 404 | "cell_type": "code",
|
343 |
| - "execution_count": 23, |
| 405 | + "execution_count": 9, |
344 | 406 | "metadata": {
|
345 | 407 | "tags": []
|
346 | 408 | },
|
|
355 | 417 | " [0., 1., 0.],\n",
|
356 | 418 | " [0., 0., 1.]]), 'affine': array([[1., 0., 0.],\n",
|
357 | 419 | " [0., 1., 0.],\n",
|
358 |
| - " [0., 0., 1.]]), 'spatial_shape': [256, 256], 'filename_or_obj': '/tmp/tmpg4lwxckh/test_image.png'}\n" |
| 420 | + " [0., 0., 1.]]), 'spatial_shape': [128, 256], 'filename_or_obj': '/tmp/tmpq5gymhdr/test_image.png'}\n" |
359 | 421 | ]
|
360 | 422 | }
|
361 | 423 | ],
|
|
383 | 445 | },
|
384 | 446 | {
|
385 | 447 | "cell_type": "code",
|
386 |
| - "execution_count": 27, |
| 448 | + "execution_count": 10, |
387 | 449 | "metadata": {},
|
388 | 450 | "outputs": [],
|
389 | 451 | "source": [
|
|
0 commit comments