Acquisition type restricted charts for CT

Issue #877 resolved
Ed McDonagh created an issue

As part of the changes to charts for release 1.0, and the removal of the acquisition type tick boxes in the filters as part of ref #856, the feature to show only acquisitions of a specific type when creating acquisition level charts has been removed.

This issue is to remind us to re-implement the feature in the future if it seems desirable.

Comments (26)

  1. David Platten

    I think this needs adding for version 1.0. My Canon systems use the same acquisition name for stationary acquisitions as well as spiral or axial acquisitions within the same study. This makes the median CTDI or DLP chart values a bit meaningless.

  2. David Platten

    The acquisition types that we need to be able to filter CT acquisition chart data on are:

    • Sequenced Acquisition (“Axial”)
    • Spiral Acquisition (“Spiral”)
    • Constant Angle Acquisition (“Localiser”)
    • Stationary Acquisition
    • Free Acquisition

    The acquisition type is found via the ct_acquisition_type_id in the CtIrradiationEventData table, which relates to the id column in the ContextID table.

  3. David Platten

    I think I’m going to implement this by:

    • adding a boolean UserProfile field for each CT acquisition type in the CT chart options
    • including the CT acquisition type in the list of name_fields when an acquisition-level CT chart is chosen (around line 479 of views_charts_ct.py)
    • adding code to views_charts_ct.py to filter the contents of the Pandas data frame to keep only the required acquisition types before the chart data is calculated (after line 521, and before line 532). May be able to use something like this example: https://stackoverflow.com/questions/43269548/pandas-how-to-remove-rows-from-a-dataframe-based-on-a-list)

  4. David Platten

    Addressing some Codacy issues. To try and reduce duplication I have refactored various bits of chart form processing code that is common between the modality-specific views files and views_admin.py. Refs issue #877

    → <<cset 4624c461851d>>

  5. David Platten

    Added custom line to empty data chart message so that for CT acquisition charts we can warn the user that no acquisition types are selected. A question: should I be excluding zero values when calculating bar charts and box-plots? Are we ever interested in zero values being included? These chart types may be used for things like compression force at some point, where zero values may be of interest. Refs issue #877

    → <<cset 8bd817cbfaa0>>

  6. David Platten
    • changed status to open

    The user-selection of acquisition type in the chart options is not correctly looked up when the CT summary page is re-visited.

  7. David Platten

    The CT chart options form problem was caused by the required_ct_acquisition_types method making ct_acquistion_types lower case if the user had selected case-insensitive categories. This broke the form initialisation because the lower-case values don't match any of the expected strings. The required CT acquisition types are now made lower case (if necessary) just before they are used to exclude unwanted acquisitions in the DataFrame, resolving the problem. Refs issue #877

    → <<cset 0076520bdf3b>>

  8. David Platten

    Merged in issue877FixAcquisitionTypeChartOptionForCT (pull request #456)

    The CT chart options form problem was caused by the required_ct_acquisition_types method making ct_acquistion_types lower case if the user had selected case-insensitive categories. This broke the form initialisation because the lower-case values don't mat

    Approved-by: Ed McDonagh

    Fixes issue #877

    → <<cset e30205a32da2>>

  9. Log in to comment