Views¶
Module contents¶
Definition of the app’s rest_framework.viewsets.ViewSet subclasses.
Submodules¶
django_dicom.views.defaults module¶
Definition of the DefaultsMixin mixin.
-
class
django_dicom.views.defaults.DefaultsMixin¶ Bases:
objectDefault settings for view authentication, permissions and filtering.
-
authentication_classes= (<class 'rest_framework.authentication.BasicAuthentication'>, <class 'rest_framework.authentication.TokenAuthentication'>)¶
-
filter_backends= (<class 'django_filters.rest_framework.backends.DjangoFilterBackend'>, <class 'rest_framework.filters.SearchFilter'>, <class 'rest_framework.filters.OrderingFilter'>)¶
-
permission_classes= (<class 'rest_framework.permissions.IsAuthenticated'>,)¶
-
django_dicom.views.image module¶
Definition of the ImageViewSet class.
-
class
django_dicom.views.image.ImageViewSet(**kwargs)¶ Bases:
django_dicom.views.defaults.DefaultsMixin,rest_framework.viewsets.ModelViewSetAPI endpoint that allows images to be viewed or edited.
-
filter_class¶
-
get_queryset()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
ordering_fields= ('series', 'number', 'date', 'time')¶
-
pagination_class¶ alias of
django_dicom.views.pagination.StandardResultsSetPagination
-
parser_classes= (<class 'rest_framework.parsers.MultiPartParser'>,)¶
-
queryset¶
-
search_fields= ('number', 'date', 'time', 'uid')¶
-
serializer_class¶ alias of
django_dicom.serializers.image_serializer.ImageSerializer
-
django_dicom.views.pagination module¶
Definition of the StandardResultsSetPagination class.
-
class
django_dicom.views.pagination.StandardResultsSetPagination¶ Bases:
rest_framework.pagination.PageNumberPaginationDefault pagination parameters. This didn’t work as part of the DefaultsMixin and therefore has to be defined separately in the ‘pagination_class’ configuration.
-
max_page_size= 10000¶
-
page_size= 25¶
-
page_size_query_param= 'page_size'¶
-
django_dicom.views.patient module¶
Definition of the PatientViewSet class.
-
class
django_dicom.views.patient.PatientViewSet(**kwargs)¶ Bases:
django_dicom.views.defaults.DefaultsMixin,rest_framework.viewsets.ModelViewSetAPI endpoint that allows patients to be viewed or edited.
-
aggregate(request) → rest_framework.response.Response¶ Returns related model counts if count filtering is enabled.
Parameters: request (Request) – API request Returns: Aggregated queryset or informational message Return type: Response
-
download_series_set(request, uid)¶
-
filter_class¶
-
get_queryset() → django.db.models.query.QuerySet¶ Overrides the parent
get_queryset()method to apply aggregated annotation if count filtering is enabled.Returns: Patient queryset Return type: QuerySet
-
ordering_fields= ('id', 'uid', 'family_name', 'given_name', 'sex', 'date_of_birth', 'latest_study_time')¶
-
pagination_class¶ alias of
django_dicom.views.pagination.StandardResultsSetPagination
-
queryset¶
-
serializer_class¶ alias of
django_dicom.serializers.patient_serializer.PatientSerializer
-
django_dicom.views.series module¶
Definition of the SeriesViewSet class.
-
class
django_dicom.views.series.SeriesViewSet(**kwargs)¶ Bases:
django_dicom.views.defaults.DefaultsMixin,rest_framework.viewsets.ModelViewSetAPI endpoint that allows series to be viewed or edited.
-
filter_class¶
-
get_csv(request: rest_framework.request.Request) → rest_framework.response.Response¶
-
get_manufacturers(request)¶
-
get_queryset()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
listed_zip(request: rest_framework.request.Request, series_ids: str) → django.http.response.FileResponse¶
-
ordering_fields= ('study', 'patient', 'number', 'date', 'time', 'scanning_sequence', 'sequence_variant', 'pixel_spacing', 'echo_time', 'inversion_time', 'repetition_time', 'manufacturer', 'manufacturer_model_name', 'magnetic_field_strength', 'device_serial_number', 'institution_name', 'sequence_type')¶
-
pagination_class¶ alias of
django_dicom.views.pagination.StandardResultsSetPagination
-
queryset¶
-
search_fields= ('study', 'patient', 'body_part_examined', 'number', 'description', 'date', 'time', 'modality', 'protocol_name', 'scanning_sequence', 'sequence_variant', 'pixel_spacing', 'echo_time', 'inversion_time', 'repetition_time', 'flip_angle', 'manufacturer', 'manufacturer_model_name', 'magnetic_field_strength', 'device_serial_number', 'institution_name', 'uid')¶
-
serializer_class¶ alias of
django_dicom.serializers.series_serializer.SeriesSerializer
-
to_zip(request: rest_framework.request.Request, pk: int) → django.http.response.FileResponse¶
-
django_dicom.views.study module¶
Definition of the StudyViewSet class.
-
class
django_dicom.views.study.StudyViewSet(**kwargs)¶ Bases:
django_dicom.views.defaults.DefaultsMixin,rest_framework.viewsets.ModelViewSetAPI endpoint that allows studies to be viewed or edited.
-
aggregate(request) → rest_framework.response.Response¶ Returns related model counts if count filtering is enabled.
Parameters: request (Request) – API request Returns: Aggregated queryset or informational message Return type: Response
-
filter_class¶
-
get_queryset() → django.db.models.query.QuerySet¶ Overrides the parent
get_queryset()method to apply aggregated annotation if count filtering is enabled.Returns: Study queryset Return type: QuerySet
-
pagination_class¶ alias of
django_dicom.views.pagination.StandardResultsSetPagination
-
queryset¶
-
serializer_class¶ alias of
django_dicom.serializers.study_serializer.StudySerializer
-