Hi Arash,
Have a good look at the dcm4che toolkit, which will give you the wherewithal to accomplish this. There is a sample program for DICOMDIR provided, which is described
here.
If it's an ImageJ plugin you are after, the first point of call is to inspect the excellent Tudor DICOM Tools. the wiki page is
here.
Neil