adjustments to function_DTI_CHARMED_custom_apply. Trying to find an dimension error