An elegant Python interface for visualization on the web platform to interactively generate insights into multidimensional images, point sets, and geometry.
---------------------------------------------------------------------------
TemplateTypeError Traceback (most recent call last)
<ipython-input-3-699f0f1fc150> in <module>
6 urlretrieve(url, file_name)
7 image = itk.imread(file_name, itk.RGBPixel[itk.UC])
----> 8 viewer = view(image, rotate=True, gradient_opacity=0.8)
~/anaconda3/envs/lab-morphogenesis/lib/python3.8/site-packages/itkwidgets/widget_viewer.py in view(image, label_image, label_image_names, label_image_weights, label_image_blend, cmap, lut, select_roi, interpolation, gradient_opacity, opacity_gaussians, channels, slicing_planes, shadow, blend_mode, point_sets, point_set_colors, point_set_opacities, point_set_representations, point_set_sizes, geometries, geometry_colors, geometry_opacities, ui_collapsed, rotate, annotations, axes, mode, **kwargs)
1063 image = images[0]
1064
-> 1065 viewer = Viewer(image=image,
1066 label_image=label_image,
1067 label_image_names=label_image_names,
~/anaconda3/envs/lab-morphogenesis/lib/python3.8/site-packages/itkwidgets/widget_viewer.py in __init__(self, **kwargs)
408 if size[dim] > self.size_limit_3d[dim]:
409 self._downsampling = True
--> 410 self._update_rendered_image()
411 if self._downsampling:
412 self.observe(self._on_roi_changed, ['roi'])
~/anaconda3/envs/lab-morphogenesis/lib/python3.8/site-packages/itkwidgets/widget_viewer.py in _update_rendered_image(self)
488 if self.image:
489 self.extractor = itk.ExtractImageFilter.New(self.image)
--> 490 self.shrinker = itk.ShrinkImageFilter.New(self.extractor)
491 self.shrinker.SetShrinkFactors(scale_factors[:dimension])
492 if self.label_image:
~/anaconda3/envs/lab-morphogenesis/lib/python3.8/site-packages/itkTemplate.py in New(self, *args, **kwargs)
522 or via one of the following keyword arguments: %s""" % ", ".join(primary_input_methods))
523 else:
--> 524 raise TemplateTypeError(self, input_type)
525 return self[list(keys)[0]].New(*args, **kwargs)
526
TemplateTypeError: itk.ShrinkImageFilter is not wrapped for input type `None`.
To limit the size of the package, only a limited number of
types are available in ITK Python. To print the supported
types, run the following command in your python environment:
itk.ShrinkImageFilter.GetTypes()
Possible solutions:
* If you are an application user:
** Convert your input image into a supported format (see below).
** Contact developer to report the issue.
* If you are an application developer, force input images to be
loaded in a supported pixel type.
e.g.: instance = itk.ShrinkImageFilter[itk.Image[itk.SS,2], itk.Image[itk.SS,2]].New(my_input)
* (Advanced) If you are an application developer, build ITK Python yourself and
turned to `ON` the corresponding CMake option to wrap the pixel type or image
dimension you need. When configuring ITK with CMake, you can set
`ITK_WRAP_${type}` (replace ${type} with appropriate pixel type such as
`double`). If you need to support images with 4 or 5 dimensions, you can add
these dimensions to the list of dimensions in the CMake variable
`ITK_WRAP_IMAGE_DIMS`.
Supported input types:
itk.Image[itk.SS,2]
itk.Image[itk.SS,3]
itk.Image[itk.UC,2]
itk.Image[itk.UC,3]
itk.Image[itk.US,2]
itk.Image[itk.US,3]
itk.Image[itk.F,2]
itk.Image[itk.F,3]
itk.Image[itk.D,2]
itk.Image[itk.D,3]
Hi. I am trying to run the example found in
VolumeOpacityTransferFunction.ipynb
, but I am getting this:Error:
My config:
Any idea of how to fix this?