1. OpenREM
  2. OpenREM
  3. OpenREM
  4. Issues

Issues

Issue #221 resolved

Acquisition-level filters don't really filter the displayed data or charts

David Platten
created an issue

The filters work at a study level.

If a user chooses a maximum acquisition DLP filter of 1000 mGy.cm then all studies with at least one acquisition at or below 1000 mGy.cm will be shown. This will pretty much show everything, as the scan-projection radiographs all have very small DLP values.

The corresponding chart of mean acquisition DLP includes lots of data that exceeds the user's maximum value of 1000 mGy.cm. Not really what they want, I suspect. Certainly not what I wanted when I used this earlier on this afternoon.

The solution? I don't think that it's straightforward so sort out the tabulated data that is displayed. However, I think the acquisition-related charts can be sorted out.

In view.py the acquisition_events variable is designed to contain all acquisitions that are in the currently filtered studies:

acquisition_events = CtIrradiationEventData.objects.exclude(
    ct_acquisition_type__code_meaning__exact = u'Constant Angle Acquisition'
).exclude(
    dlp__isnull=True
).filter(
    ct_radiation_dose__general_study_module_attributes__study_instance_uid__in = expInclude
)

This variable needs to be more strictly filtered to remove values that are not required. It's ugly because you have to check that there is a valid value in the filter before you try and apply it. The example below is missing the acquisition protocol filter too, which will make it a whole lot more ugly:

        if requestResults.get('acquisition_dlp_max') and requestResults.get('acquisition_dlp_min'):
            acquisition_events = CtIrradiationEventData.objects.exclude(
                ct_acquisition_type__code_meaning__exact = u'Constant Angle Acquisition'
            ).exclude(
                dlp__isnull=True
            ).filter(
                ct_radiation_dose__general_study_module_attributes__study_instance_uid__in = expInclude,
                dlp__lte=requestResults.get('acquisition_dlp_max'),
                dlp__gte=requestResults.get('acquisition_dlp_min')
            )
        elif requestResults.get('acquisition_dlp_max'):
            acquisition_events = CtIrradiationEventData.objects.exclude(
                ct_acquisition_type__code_meaning__exact = u'Constant Angle Acquisition'
            ).exclude(
                dlp__isnull=True
            ).filter(
                ct_radiation_dose__general_study_module_attributes__study_instance_uid__in = expInclude,
                dlp__lte=requestResults.get('acquisition_dlp_max')
            )
        elif requestResults.get('acquisition_dlp_min'):
            acquisition_events = CtIrradiationEventData.objects.exclude(
                ct_acquisition_type__code_meaning__exact = u'Constant Angle Acquisition'
            ).exclude(
                dlp__isnull=True
            ).filter(
                ct_radiation_dose__general_study_module_attributes__study_instance_uid__in = expInclude,
                dlp__gte=requestResults.get('acquisition_dlp_min')
            )
        else:
            acquisition_events = CtIrradiationEventData.objects.exclude(
                ct_acquisition_type__code_meaning__exact = u'Constant Angle Acquisition'
            ).exclude(
                dlp__isnull=True
            ).filter(
                ct_radiation_dose__general_study_module_attributes__study_instance_uid__in = expInclude
            )

I don't know of a way of elegantly implementing this at the moment, but I think it needs to be done. It probably also applies to the DX acquisition-related charts too.

Comments (7)

  1. David Platten reporter

    Applied acquisition-level filters to the CT plot data so that only acquisitions that fall within the acquisition-related filters are shown in the plots. I need to add similar code to the radiographic views. This references issue #221.

    → <<cset 2e77a3612e64>>

  2. Log in to comment