Skip to content

Commit

Permalink
[UPDATE] DocStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
FMCalisto committed Sep 28, 2024
1 parent 1efa500 commit b400982
Show file tree
Hide file tree
Showing 30 changed files with 1,165 additions and 25 deletions.
50 changes: 49 additions & 1 deletion analysis/dashboards/interactive_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,55 @@
#!/usr/bin/env python

"""
interactive_dashboard.py: Create an interactive dashboard to explore the frequency distribution of BIRADS scores across different imaging modalities.
interactive_dashboard.py: Create an interactive dashboard to explore the frequency
distribution of BIRADS scores across different imaging modalities.
This script reads a dataset of patients with BIRADS scores for mammography,
ultrasound, and MRI modalities. It then calculates the number of patients with
different combinations of modalities and creates an interactive dashboard.
The dashboard allows users to explore the distribution of BIRADS scores for
each modality and their combinations.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Create an interactive dashboard to explore the distribution of BIRADS scores.
Expected Usage:
- Run the script to generate an interactive dashboard.
- Open the dashboard in a web browser to explore the data interactively.
- Update the script to customize the dataset or modify the dashboard as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the dashboard.
- The dashboard layout, style, and interactivity can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Dash library: https://dash.plotly.com/
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
Example:
- Run the script to generate an interactive dashboard of BIRADS score distributions.
- Open the dashboard in a web browser to explore the data interactively.
- Update the script to customize the dataset or modify the dashboard as needed.
- python interactive_dashboard.py
"""

__author__ = "Francisco Maria Calisto"
Expand Down
44 changes: 44 additions & 0 deletions analysis/plots/heatmap_modalities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@

"""
heatmap_modalities.py: Plot the frequency of patients with different combinations of imaging modalities using a heatmap.
This script reads a dataset of patients with BIRADS scores for mammography, ultrasound, and MRI modalities.
It then calculates the number of patients with different combinations of modalities and plots a heatmap.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Plot a heatmap showing the frequency of patients with different imaging modality combinations.
Expected Usage:
- Run the script to generate a heatmap of imaging modality combinations.
- Check the output figure to visualize the frequency of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the heatmap.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Heatmaps: https://en.wikipedia.org/wiki/Heat_map
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
Example:
- Run the script to generate a heatmap of imaging modality combinations.
- Check the output figure to visualize the frequency of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
- python heatmap_modalities.py
"""

__author__ = "Francisco Maria Calisto"
Expand Down
55 changes: 55 additions & 0 deletions analysis/plots/multi_panel_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@

"""
multi_panel_plot.py: Create a multi-panel plot showing the number of patients per imaging modality.
This script reads a dataset of patients with BIRADS scores for mammography, ultrasound, and MRI modalities.
It then calculates the number of patients with different combinations of modalities and creates a multi-panel plot.
The plot shows the distribution of patients with mammography, ultrasound, and MRI images side by side.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Create a multi-panel plot showing the distribution of patients across different modality combinations.
Expected Input:
- The script requires a dataset of patients with BIRADS scores for different modalities.
- The dataset should include columns for each modality (CCL, CCR, MLOL, MLOR, USL, USR, MRIL, MRIR) with BIRADS scores.
- The BIRADS scores should range from 1 to 5, with missing or invalid values handled appropriately.
Output:
- The script generates an interactive HTML file with the multi-panel plot.
- The plot shows the distribution of patients with mammography, ultrasound, and MRI images.
- The chart can be viewed in a web browser or embedded in a web page.
Expected Usage:
- Run the script to generate a multi-panel plot of imaging modality counts.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the multi-panel plot.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Multi-panel plots: https://en.wikipedia.org/wiki/Multipanel_plot
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
Example:
- Run the script to generate a multi-panel plot of imaging modality counts.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
- python multi_panel_plot.py
"""

__author__ = "Francisco Maria Calisto"
Expand Down
42 changes: 42 additions & 0 deletions analysis/plots/plot_birads_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,48 @@
"""
plot_birads_frequency.py: Plot frequency of patients with MGs, US images, and MRIs for each BIRADS score,
handling multiple entries per cell by considering the highest BIRADS score and multiple delimiters.
This script reads a dataset of patients with BIRADS scores for mammography, ultrasound, and MRI modalities.
It then calculates the number of patients with different combinations of modalities and plots a stacked bar chart.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Plot a stacked bar chart showing the distribution of patients across different modality combinations.
Expected Usage:
- Run the script to generate a stacked bar chart of imaging modality combinations.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the stacked bar chart.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Stacked bar charts: https://en.wikipedia.org/wiki/Stacked_bar_chart
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
Example:
- Run the script to generate a stacked bar chart of imaging modality combinations.
"""

__author__ = "Francisco Maria Calisto"
Expand Down
55 changes: 55 additions & 0 deletions analysis/plots/plot_birads_mg_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,61 @@
"""
plot_birads_mg_frequency.py: Plot the frequency of patients for
each MG type (CCL, CCR, MLOL, MLOR) with BIRADS scores from 1 to 5.
This script reads a dataset of patients with BIRADS scores for mammography,
ultrasound, and MRI modalities. It then calculates the number of patients
with different combinations of modalities and plots a stacked bar chart.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Plot a stacked bar chart showing the distribution of patients across different modality combinations.
Expected Input:
- The script requires a dataset of patients with BIRADS scores for different modalities.
- The dataset should include columns for each modality (CCL, CCR, MLOL, MLOR) with BIRADS scores.
- The BIRADS scores should range from 1 to 5, with missing or invalid values handled appropriately.
Output:
- The script generates an interactive HTML file with the stacked bar chart.
- The chart shows the distribution of patients across different modality combinations.
- The chart can be viewed in a web browser or embedded in a web page.
Expected Usage:
- Run the script to generate a stacked bar chart of imaging modality combinations.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the stacked bar chart.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Stacked bar charts: https://en.wikipedia.org/wiki/Stacked_bar_chart
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
Example:
- Run the script to generate a stacked bar chart of imaging modality combinations.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
- python plot_birads_mg_frequency.py
"""

__author__ = "Francisco Maria Calisto"
Expand Down
38 changes: 38 additions & 0 deletions analysis/plots/plot_birads_mri_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

"""
plot_birads_mri_frequency.py: Plot the frequency of patients with MRI images per BIRADS category.
This script reads a dataset of patients with BIRADS scores for mammography, ultrasound, and MRI modalities.
It then calculates the number of patients with different combinations of modalities and plots a stacked bar chart.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Plot a stacked bar chart showing the distribution of patients across different modality combinations.
Expected Usage:
- Run the script to generate a stacked bar chart of imaging modality combinations.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the stacked bar chart.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Stacked bar charts: https://en.wikipedia.org/wiki/Stacked_bar_chart
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
"""

__author__ = "Francisco Maria Calisto"
Expand Down
38 changes: 38 additions & 0 deletions analysis/plots/plot_birads_mri_side_by_side.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

"""
plot_birads_mri_side_by_side.py: Plot the frequency of patients with MRI images per BIRADS category, displayed side-by-side.
This script reads a dataset of patients with BIRADS scores for mammography, ultrasound, and MRI modalities.
It then calculates the number of patients with different combinations of modalities and plots a stacked bar chart.
Key Functions:
- Load the dataset of patients with BIRADS scores for different modalities.
- Calculate the number of patients with different combinations of modalities.
- Plot a stacked bar chart showing the distribution of patients across different modality combinations.
Expected Usage:
- Run the script to generate a stacked bar chart of imaging modality combinations.
- Check the output figure to visualize the distribution of patients across different combinations.
- Update the script to customize the dataset or modify the plot as needed.
Customization & Flexibility:
- The script can be adapted to work with different datasets or modalities.
- Additional metadata or information can be included in the stacked bar chart.
- The plot style, colors, and labels can be customized based on requirements.
Performance & Compatibility:
- The script is optimized for performance when handling large datasets.
- It uses the Plotly library to create interactive and visually appealing plots.
- The script is compatible with Python 3.6+ and common data science libraries.
Best Practices & Maintenance:
- The script follows best practices for data visualization and analysis.
- It provides a clear and informative representation of imaging modality data.
- The script is well-documented and can be easily maintained or extended.
Notes:
- This script is part of a data analysis pipeline for multimodal breast imaging data.
- It is designed to visualize the distribution of imaging modalities for patients.
- The script can be integrated into a larger data processing or analysis workflow.
References:
- Plotly library: https://plotly.com/python/
- Stacked bar charts: https://en.wikipedia.org/wiki/Stacked_bar_chart
- Data visualization: https://en.wikipedia.org/wiki/Data_visualization
- Data analysis: https://en.wikipedia.org/wiki/Data_analysis
"""

__author__ = "Francisco Maria Calisto"
Expand Down
Loading

0 comments on commit b400982

Please sign in to comment.