jp2_family_in.Open(r.getImageFile(), true);
inputSource.Open(jp2_family_in, loc);
inputSource.Read_header();
kduIn = inputSource;
Kdu_codestream codestream = new Kdu_codestream();
codestream.Create(kduIn);
Kdu_channel_mapping channels = new Kdu_channel_mapping();
if (inputSource.Exists()) {
channels.Configure(inputSource, false);
} else {
channels.Configure(codestream);