Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Series Selector dictionary #300

Closed
vikashg opened this issue May 17, 2022 · 1 comment
Closed

[DOC] Series Selector dictionary #300

vikashg opened this issue May 17, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@vikashg
Copy link
Collaborator

vikashg commented May 17, 2022

Report incorrect documentation

Location of incorrect documentation

Describe the problems or issues found in the documentation
The rules specified are not very clear. What is CT Series 1 and CT Series 2. >

Steps taken to verify documentation is incorrect
I wrote a series selector for my application and I get the following error

	data_loader = DICOMDataLoaderOperator()
	data_study_list = data_loader.load_data_to_studies(dcm_dir)
	study_list = '{"selections" : [ \
					{"name" : "Mammo Series 1", \
					"conditions" :{ \
					"SeriesDescription": "(?i)^CC",\
					"Modality": "MG"}\
					}]}'
	study_selector_json = json.loads(study_list)
	study_selector_op = DICOMSeriesSelectorOperator(study_selector_json)
	selector = DICOMSeriesSelectorOperator()
	print(type(study_selector_json))
	selected_study = selector.filter(study_selector_json, data_study_list)

I get the following error

{'selections': [{'name': 'Mammo Series 1', 'conditions': {'SeriesDescription': '(?i)^CC', 'Modality': 'MG'}}]}
Traceback (most recent call last):
  File "test.py", line 63, in <module>
    main()
  File "test.py", line 49, in main
    study_selector_op = DICOMSeriesSelectorOperator(study_selector_json)
  File "/workspace/app/monai-deploy-app-sdk/monai/deploy/operators/dicom_series_selector_operator.py", line 82, in __init__
    self._rules_json_str = rules if rules and rules.strip() else None
AttributeError: 'dict' object has no attribute 'strip'
@vikashg vikashg added the documentation Improvements or additions to documentation label May 17, 2022
@MMelQin
Copy link
Collaborator

MMelQin commented May 25, 2022

The constructor of DICOMSeriesSelectorOperator takes in JSON text, not loaded JSON object. In the example,
instead of study_selector_op = DICOMSeriesSelectorOperator(study_selector_json)
please use study_selector_op = DICOMSeriesSelectorOperator(study_list)

@vikashg vikashg closed this as completed May 25, 2022
@MMelQin MMelQin added this to the v0.4 milestone May 25, 2022
@gigony gigony mentioned this issue Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants