<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def pick_t1w(mri):
    ''' Pick the MR T1w from the dictionary for MR->PET registration.
    '''

    if isinstance(mri, dict):
        # check if NIfTI file is given
        if 'T1N4' in mri and os.path.isfile(mri['T1N4']):
            ft1w = mri['T1N4']
        # or another bias corrected
        elif 'T1bc' in mri and os.path.isfile(mri['T1bc']):
            ft1w = mri['T1bc']
        elif 'T1nii' in mri and os.path.isfile(mri['T1nii']):
            ft1w = mri['T1nii']
        elif 'T1DCM' in mri and os.path.exists(mri['MRT1W']):
            # create file name for the converted NIfTI image
            fnii = 'converted'
            call( [rs.DCM2NIIX, '-f', fnii, mri['T1nii'] ] )
            ft1nii = glob.glob( os.path.join(mri['T1nii'], '*converted*.nii*') )
            ft1w = ft1nii[0]
        else:
            print 'e> disaster: could not find a T1w image!'
            return None
            
    else:
        ('e> no correct input found for the T1w image')
        return None

    return ft1w