Skip to content

Commit

Permalink
fix(dicom): Python Json types corrections, wasi dicom series handling
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Aug 21, 2023
1 parent 49b10eb commit c9abf86
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Generated file. Do not edit.

from pathlib import Path
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from .js_package import js_package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from .js_package import js_package

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated file. Do not edit.

from pathlib import Path
import os
from typing import Dict, Tuple, Optional, List
Expand All @@ -20,7 +18,7 @@
async def read_image_dicom_file_series_async(
input_images: List[os.PathLike] = [],
single_sorted_series: bool = False,
) -> Tuple[Image, Dict]:
) -> Tuple[Image, List[str]]:
"""Read a DICOM image series and return the associated image volume
:param input_images: File names in the series
Expand All @@ -33,7 +31,7 @@ async def read_image_dicom_file_series_async(
:rtype: Image
:return: Output sorted filenames
:rtype: Dict
:rtype: List[str]
"""
js_module = await js_package.js_module
web_worker = js_resources.web_worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from .js_package import js_package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from .js_package import js_package

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated file. Do not edit.

from pathlib import Path, PurePosixPath
import os
from typing import Dict, Tuple, Optional, List
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path, PurePosixPath
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from importlib_resources import files as file_resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Generated file. Do not edit.

from pathlib import Path, PurePosixPath
import os
from typing import Dict, Tuple, Optional, List
Expand All @@ -20,7 +18,7 @@
def read_image_dicom_file_series(
input_images: List[os.PathLike] = [],
single_sorted_series: bool = False,
) -> Tuple[Image, Dict]:
) -> Tuple[Image, List[str]]:
"""Read a DICOM image series and return the associated image volume
:param input_images: File names in the series
Expand All @@ -33,7 +31,7 @@ def read_image_dicom_file_series(
:rtype: Image
:return: Output sorted filenames
:rtype: Dict
:rtype: List[str]
"""
global _pipeline
if _pipeline is None:
Expand All @@ -53,10 +51,9 @@ def read_image_dicom_file_series(
args.append('0')
args.append('1')
# Options
if len(input_images) > 1:
if len(input_images) < 1:
raise ValueError('"input-images" option must have a length > 1')

if len(input_images) < 1:
raise ValueError('"input-images" kwarg must have a length > 1')
if len(input_images) > 0:
args.append('--input-images')
for value in input_images:
input_file = str(PurePosixPath(input_images))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path, PurePosixPath
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from importlib_resources import files as file_resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path, PurePosixPath
import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from importlib_resources import files as file_resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand All @@ -17,7 +17,7 @@ def apply_presentation_state_to_image(
frame: int = 1,
no_presentation_state_output: bool = False,
no_bitmap_output: bool = False,
) -> Tuple[Dict, Image]:
) -> Tuple[Any, Image]:
"""Apply a presentation state to a given DICOM image and render output as bitmap, or dicom file.
:param image_in: Input DICOM file
Expand All @@ -42,7 +42,7 @@ def apply_presentation_state_to_image(
:type no_bitmap_output: bool
:return: Output overlay information
:rtype: Dict
:rtype: Any
:return: Output image
:rtype: Image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand All @@ -17,7 +17,7 @@ async def apply_presentation_state_to_image_async(
frame: int = 1,
no_presentation_state_output: bool = False,
no_bitmap_output: bool = False,
) -> Tuple[Dict, Image]:
) -> Tuple[Any, Image]:
"""Apply a presentation state to a given DICOM image and render output as bitmap, or dicom file.
:param image_in: Input DICOM file
Expand All @@ -42,7 +42,7 @@ async def apply_presentation_state_to_image_async(
:type no_bitmap_output: bool
:return: Output overlay information
:rtype: Dict
:rtype: Any
:return: Output image
:rtype: Image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand All @@ -12,7 +12,7 @@
def read_image_dicom_file_series(
input_images: List[os.PathLike] = [],
single_sorted_series: bool = False,
) -> Tuple[Image, Dict]:
) -> Tuple[Image, Any]:
"""Read a DICOM image series and return the associated image volume
:param input_images: File names in the series
Expand All @@ -25,7 +25,7 @@ def read_image_dicom_file_series(
:rtype: Image
:return: Output sorted filenames
:rtype: Dict
:rtype: Any
"""
func = environment_dispatch("itkwasm_dicom", "read_image_dicom_file_series")
output = func(input_images=input_images, single_sorted_series=single_sorted_series)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand All @@ -12,7 +12,7 @@
async def read_image_dicom_file_series_async(
input_images: List[os.PathLike] = [],
single_sorted_series: bool = False,
) -> Tuple[Image, Dict]:
) -> Tuple[Image, Any]:
"""Read a DICOM image series and return the associated image volume
:param input_images: File names in the series
Expand All @@ -25,7 +25,7 @@ async def read_image_dicom_file_series_async(
:rtype: Image
:return: Output sorted filenames
:rtype: Dict
:rtype: Any
"""
func = environment_dispatch("itkwasm_dicom", "read_image_dicom_file_series_async")
output = await func(input_images=input_images, single_sorted_series=single_sorted_series)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated file. Do not edit.

import os
from typing import Dict, Tuple, Optional, List
from typing import Dict, Tuple, Optional, List, Any

from itkwasm import (
environment_dispatch,
Expand Down

0 comments on commit c9abf86

Please sign in to comment.