Generally, MRI outperforms CT for detecting choledocholithiasis and pancreatic necrosis and should be done in patients in whom other tests for choledocholithiasis were indeterminate and in patients who are considered likely to need a pancreatic drainage procedure.