Skip to content

Commit

Permalink
extend fmri types + ctbi ga 2017 feedback (floating tr + non normaliz…
Browse files Browse the repository at this point in the history
…ed type)

Signed-off-by: Stephen L. <[email protected]>
  • Loading branch information
lrq3000 committed Sep 24, 2017
1 parent 51185ec commit 241e768
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions center-tbi-statistics-from-full-rest-dump.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
"outputs": [],
"source": [
"# Extract only resting state data\n",
"rsfMRI_filter = ['rs fMRI FE EPI', 'rs fMRI FE_EPI', 'rs fMRI FE_EPI SENSE', 'rs-fMRI', 'rs_fMRI', 'rsfMRI', 'rsfMRI 60CM']\n",
"rsfMRI_filter = ['rs fMRI FE EPI', 'rs fMRI FE_EPI', 'rs fMRI FE_EPI SENSE', 'rs-fMRI', 'rs_fMRI', 'rsfMRI', 'rsfMRI 60CM', 'Resting State fMRI', ' rsfMRI', 'RESTING STATE']\n",
"df_rest = df.loc[df['@type'].isin(rsfMRI_filter), :]\n",
"#df_rest = df.loc[df['@type'] == 'rs_fMRI', :] # deprecated, only for rs_fmri, does not include all variants of the name in db\n",
"df_rest[['@UID', 'project.id', 'qa.protocol_check_global']]"
Expand Down Expand Up @@ -1681,10 +1681,50 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"source": []
"source": [
"# Extract scans non normalized type\n",
"df_rest_notnormtype = df_rest[df_rest['@type'] != 'rs_fMRI']\n",
"save_df_as_csv(df_rest_notnormtype.fillna(''), 'xnat_data_extract_rest-notnormtype.csv', index=False, encoding='utf-8')\n",
"print(len(df_rest_notnormtype))\n",
"df_rest_notnormtype"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Extract only scans with an exact TR (with a floating value)\n",
"import numpy as np\n",
"df_rest_floattr = df_rest[df_rest['xnat:parameters.xnat:tr'].astype('float').apply(lambda x: not x.is_integer() and not pd.isnull(x))]\n",
"print('List of scanners with floating TR values:')\n",
"print(df_rest_floattr['experiment.xnat:scanner'].value_counts())\n",
"print('\\nList of unique floating TR values:')\n",
"print(df_rest_floattr['xnat:parameters.xnat:tr'].unique())\n",
"print('\\nList of subjects ids with floating TR value:')\n",
"print(df_rest_floattr['subject.@ID'].unique())\n",
"print('\\nList of experiments with floating TR values:')\n",
"print(df_rest_floattr.ix[:, ('experiment.id', 'subject.id', 'xnat:parameters.xnat:tr')])\n",
"save_df_as_csv(df_rest_floattr.ix[:, ('experiment.id', 'subject.id', 'xnat:parameters.xnat:tr')].fillna(''), 'xnat_data_extract_rest-floattr.csv', index=False, encoding='utf-8')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Print all scanners unique names with scans counts (to compare with the scanners with floating TR)\n",
"df_rest['experiment.xnat:scanner'].value_counts()"
]
}
],
"metadata": {
Expand Down

0 comments on commit 241e768

Please sign in to comment.