The syntax of
foreach
is pretty simple:
foreach (Type variablename in Collection)
You have forgotten to add the variable name in each of the
foreach
statements, so it doesn't know where to put each instance in the collection:
foreach ( Patient patient in ddir.Children) {
foreach ( Study study in patient.Children) {
foreach ( series ser in study.Children) {
foreach ( instance inst in ser.Children) {
pixelData = inst.Value(0x88, 0x200);