SELECT DISTINCT
    rawImfile.*,
    warpRun.cam_id,
    chipProcessedImfile.uri as chip_uri,
    chipProcessedImfile.path_base as chip_path_base,
    camProcessedExp.path_base as cam_path_base
FROM warpRun
JOIN camProcessedExp
    USING(cam_id)
JOIN chipRun
    ON camProcessedExp.chip_id = chipRun.chip_id
JOIN chipProcessedImfile
    ON camProcessedExp.chip_id = chipProcessedImfile.chip_id
JOIN rawImfile -- is there any reason not to refer back to rawimfiles?
    ON chipProcessedImfile.exp_id = rawImfile.exp_id AND chipProcessedImfile.class_id = rawImfile.class_id 
WHERE
    warpRun.state = 'run'

