brickstudy.foundation module

Copyright 2024 Rotterdam University Medical Center. Licensed under the Apache License, version 2.0. See LICENSE for details. This file contains methods to deal with DICOMS. Note the package will have an optional pydicom dependancy, without it this module has functions related to dicoms that will not work.

class brickstudy.foundation.NiftiSliceViewer(volume_str, figsize=(10, 10))

Bases: object

A class to examine slices of MRIs, which are in Nifti Format

plot_slice(z)
transpose(view)
brickstudy.foundation.check_and_print_commas(df)

converts all values in a DataFrame to strings, then check if any values have commas. If a value has a comma, print the location of the value. Returns number of comma values

brickstudy.foundation.check_dimensions_of_voxel(image_string)

This function if given a dicom string will return the dimensions as a tuple, and print a message about them

brickstudy.foundation.compare_sheets(excel_book_name)

This function reads a multisheet excel and prints back some infor you want to know before merging

brickstudy.foundation.csv_my_excel(excel_book_name, keyname)

this function takes a multisheet excel and reads in the sheets into a csv

brickstudy.foundation.find_my_key(excel_book_name)

This function reads a multi-sheet excel file’s sheets into pandas objects, and finds the common columns

brickstudy.foundation.map_for_commas(df)

checks if there are any string values with commas in a pandas DataFrame, and return a datadrame with booleans, then a dataframe to show the values

Parameters:

df (dateframe) – The DataFrame to check.

Returns:

tuple of two dataframes one with bools for check, one with values

Return type:

class:

tuple

brickstudy.foundation.map_for_commas_if_all_strings(df)

checks if there are any values with commas in a pandas DataFrame, and returns a datadrame with bools, then a dataframe which shows values

Parameters:

df (dateframe) – The DataFrame to check.

Returns:

tuple of two dataframes based on with bools for check

Return type:

class:

tuple

brickstudy.foundation.show_neg_value_patients(df, cutoff_number=0)

this function returns dataframes, one below and including, and one above a cutoff