Problem with WholeSlideDataConfiguration

Problem with WholeSlideDataConfiguration  

  By: antoniosantos on March 30, 2022, 12:51 a.m.

Good night dear. How is everything?

I have a problem to create the batch_iterator of the wholeslidedata library

Error \/


RegistrantNotRegisteredError Traceback (most recent call last) Input In [5], in () ----> 1 with create_batch_iterator(mode=mode, user_config=user_config, cpus=cpus) as training_batch_iterator: 2 pprint(training_batch_iterator.dataset.annotations_per_label_per_key)

File D:\anaconda3\lib\site-packages\wholeslidedata\iterators.py:60, in create_batch_iterator(user_config, mode, batches, update, presets, cpus, context, determinstic, iterator_class) 45 def create_batch_iterator( 46 user_config, 47 mode, (...) 54 iterator_class=BatchIterator, 55 ): 56 config_builder = WholeSlideDataConfiguration.build( 57 user_config=user_config, modes=(mode,), build_instances=False, presets=presets 58 ) ---> 60 builds = WholeSlideDataConfiguration.build( 61 user_config=user_config, modes=(mode,), presets=presets 62 ) 64 update_queue = Queue() if update else None 66 batch_commander = BatchCommander( 67 config_builder=config_builder, 68 mode=mode, 69 reset_index=batches, 70 update_queue=update_queue, 71 )

File D:\anaconda3\lib\site-packages\creationism\configuration\config.py:294, in Configuration.build(cls, user_config, modes, build_instances, build_key, presets, external_configurations, search_paths, args, kwargs) 292 resolve_none(configuration) 293 if build_instances: --> 294 return configuration.build_instances(external_configurations=external_configurations, build_key=build_key) 295 return configuration*

File D:\anaconda3\lib\site-packages\creationism\configuration\config.py:320, in Configuration.build_instances(self, external_configurations, build_key) 317 build_keys = build_keys[:index] 319 for key in build_keys: --> 320 build[mode][key] = build[mode][key].build(configurations) 322 build = build.cast() 323 if build_key:

File D:\anaconda3\lib\site-packages\creationism\configuration\config.py:242, in ConfigDict.build(self, configuration) 231 return ConfigObject( 232 _build_registrant_object( 233 self, (...) 238 ) 239 ) 241 if module is not None and attribute is not None: --> 242 return ConfigObject(_build_object(self, module, attribute)) 244 return self

File D:\anaconda3\lib\site-packages\creationism\configuration\config.py:348, in _build_object(builds, module, attribute) 346 for attr in attributes: 347 attribute = getattr(attribute, attr) --> 348 return attribute(builds.cast())

File D:\anaconda3\lib\site-packages\wholeslidedata\dataset.py:132, in WholeSlideDataSet.init(self, mode, associations, labels, renamed_labels, load_images, copy_path) 130 self._load_images = load_images 131 self._copy_path = copy_path --> 132 super().init(mode, associations, labels, renamed_labels)

File D:\anaconda3\lib\site-packages\wholeslidedata\dataset.py:40, in DataSet.init(self, mode, associations, labels, renamed_labels) 37 self._labels = labels 38 self._renamed_labels = renamed_labels ---> 40 self.data = self._open(self._associations) 41 self._sample_references, self._all_sample_references = self._init_samples(self.data) 42 self._all_labels = Labels.create(list(self._all_sample_references.keys()))

File D:\anaconda3\lib\site-packages\wholeslidedata\dataset.py:144, in WholeSlideDataSet._open(self, associations) 137 data[file_key] = { 138 WholeSlideDataSet.IMAGES_IDENTIFIER: dict(), 139 WholeSlideDataSet.ANNOTATIONS_IDENTIFIER: dict(), 140 } 141 for wsi_index, wsi_file in enumerate(associated_files[WholeSlideImageFile]): 142 data[file_key][WholeSlideDataSet.IMAGES_IDENTIFIER][ 143 wsi_index --> 144 ] = self._open_image(wsi_file) 145 for wsa_index, wsa_file in enumerate( 146 associated_files[WholeSlideAnnotationFile] 147 ): 148 data[file_key][WholeSlideDataSet.ANNOTATIONS_IDENTIFIER][ 149 wsa_index 150 ] = self._open_annotation(wsa_file)

File D:\anaconda3\lib\site-packages\wholeslidedata\dataset.py:157, in WholeSlideDataSet._open_image(self, wsi_file) 155 wsi_file.copy(self._copy_path) 156 if self._load_images: --> 157 return wsi_file.open() 158 return wsi_file.path

File D:\anaconda3\lib\site-packages\wholeslidedata\source\files.py:86, in WholeSlideImageFile.open(self) 85 def open(self): ---> 86 return WholeSlideImage(self.path, self._image_backend)

File D:\anaconda3\lib\site-packages\wholeslidedata\image\wholeslideimage.py:19, in WholeSlideImage.init(self, path, backend) 15 def init( 16 self, path: str, backend: WholeSlideImageBackend = 'openslide', 17 ) -> None: 18 self._path = Path(path) ---> 19 self._backend = WholeSlideImageBackend.create(backend, path=self._path) 20 self._extension = self._path.suffix 22 self._shapes = self._backend._init_shapes()

File D:\anaconda3\lib\site-packages\creationism\registration\factory.py:64, in RegistrantFactory.create(cls, registrant_name, return_type, args, kwargs) 55 @classmethod 56 def create( 57 cls, (...) 61 kwargs 62 ): 63 if cls._REGISTER is None: ---> 64 raise RegistrantNotRegisteredError( 65 cls=cls, 66 registrant_name=registrant_name, 67 register=cls._REGISTER, 68 ) 70 if issubclass(type(registrant_name), cls): 71 return registrant_name*

RegistrantNotRegisteredError: Registrant 'openslide' is not found in the register of class 'WholeSlideImageBackend' with an empty register.

Can anybody help me? I've already installed openslide and I'm using ubuntu as the operating system and put the file path correctly but the error still persists

 Last edited by: antoniosantos on Aug. 15, 2023, 12:56 p.m., edited 1 time in total.

Re: Problem with WholeSlideDataConfiguration  

  By: amickan on March 30, 2022, 7:09 a.m.

Dear Antonio,

This forum is only for technical support around the platform. For questions about data analysis pertaining to algorithms or challenges, please contact the respective organizers directly.

Best, Anne