Kdu_codestream codestream = new Kdu_codestream();
codestream.Create(input);
Kdu_channel_mapping channels = new Kdu_channel_mapping();
if (inputSource.Exists())
channels.Configure(inputSource, false);
else
channels.Configure(codestream);
int ref_component = channels.Get_source_component(0);
Kdu_coords ref_expansion = getReferenceExpansion(ref_component, channels, codestream);