From 1a9b04572570e68d2f14e520d7bd74ddab7432c9 Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 25 Oct 2018 16:35:14 -0400 Subject: new mask --- tksao/frame/baseload.C | 27 +++----- tksao/frame/frame.h | 11 ++++ tksao/frame/frameload.C | 172 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 191 insertions(+), 19 deletions(-) diff --git a/tksao/frame/baseload.C b/tksao/frame/baseload.C index 2e9fffd..30bcfa2 100644 --- a/tksao/frame/baseload.C +++ b/tksao/frame/baseload.C @@ -399,8 +399,7 @@ void Base::loadSliceVarCmd(const char* ch, const char* fn) void Base::loadMosaicImageAllocCmd(MosaicType type, Coord::CoordSystem sys, const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicAlloc(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(currentContext->loadMosaicImage(ALLOC, fn, img, type, sys), ll); @@ -410,8 +409,7 @@ void Base::loadMosaicImageAllocGZCmd(MosaicType type, Coord::CoordSystem sys, const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicAllocGZ(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); loadDone(currentContext->loadMosaicImage(ALLOCGZ, fn, img, type, sys), ll); @@ -421,8 +419,7 @@ void Base::loadMosaicImageChannelCmd(MosaicType type, Coord::CoordSystem sys, const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicChannel(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); @@ -432,8 +429,7 @@ void Base::loadMosaicImageChannelCmd(MosaicType type, Coord::CoordSystem sys, void Base::loadMosaicImageMMapCmd(MosaicType type, Coord::CoordSystem sys, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicMMap(currentContext, interp, fn, 1); loadDone(currentContext->loadMosaicImage(MMAP, fn, img, type, sys), ll); @@ -442,8 +438,7 @@ void Base::loadMosaicImageMMapCmd(MosaicType type, Coord::CoordSystem sys, void Base::loadMosaicImageMMapIncrCmd(MosaicType type, Coord::CoordSystem sys, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicMMapIncr(currentContext, interp, fn, 1); loadDone(currentContext->loadMosaicImage(MMAPINCR, fn, img, type, sys), ll); @@ -453,8 +448,7 @@ void Base::loadMosaicImageShareCmd(MosaicType type, Coord::CoordSystem sys, ShmType stype, int id, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicShare(currentContext, interp, stype, id, fn, 1); loadDone(currentContext->loadMosaicImage(SHARE, fn, img, type, sys), ll); @@ -463,8 +457,7 @@ void Base::loadMosaicImageShareCmd(MosaicType type, Coord::CoordSystem sys, void Base::loadMosaicImageSocketCmd(MosaicType type, Coord::CoordSystem sys, int s, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicSocket(currentContext, interp, s, fn, FitsFile::NOFLUSH, 1); loadDone(currentContext->loadMosaicImage(SOCKET, fn, img, type, sys), ll); @@ -474,8 +467,7 @@ void Base::loadMosaicImageSocketGZCmd(MosaicType type, Coord::CoordSystem sys, int s, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicSocketGZ(currentContext, interp, s, fn, FitsFile::NOFLUSH, 1); loadDone(currentContext->loadMosaicImage(SOCKETGZ, fn, img, type, sys), ll); @@ -484,8 +476,7 @@ void Base::loadMosaicImageSocketGZCmd(MosaicType type, void Base::loadMosaicImageVarCmd(MosaicType type, Coord::CoordSystem sys, const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageMosaicVar(currentContext, interp, ch, fn, 1); loadDone(currentContext->loadMosaicImage(VAR, fn, img, type, sys), ll); diff --git a/tksao/frame/frame.h b/tksao/frame/frame.h index 7d127a3..4ce1b0b 100644 --- a/tksao/frame/frame.h +++ b/tksao/frame/frame.h @@ -116,6 +116,17 @@ class Frame : public FrameBase { void loadNRRDShareCmd(ShmType, int, const char*, LayerType); void loadNRRDSocketCmd(int, const char*, LayerType); void loadNRRDVarCmd(const char*, const char*, LayerType); + + void loadMosaicImageAllocCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType); + void loadMosaicImageAllocGZCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType); + void loadMosaicImageChannelCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType); + void loadMosaicImageMMapCmd(MosaicType, Coord::CoordSystem, const char*, LayerType); + void loadMosaicImageMMapIncrCmd(MosaicType, Coord::CoordSystem, const char*, LayerType); + void loadMosaicImageShareCmd(MosaicType, Coord::CoordSystem, ShmType, int, const char*, LayerType); + void loadMosaicImageSocketCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType); + void loadMosaicImageSocketGZCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType); + void loadMosaicImageVarCmd(MosaicType, Coord::CoordSystem, const char*,const char*, LayerType); + }; #endif diff --git a/tksao/frame/frameload.C b/tksao/frame/frameload.C index b3e1b2d..79f4b89 100644 --- a/tksao/frame/frameload.C +++ b/tksao/frame/frameload.C @@ -395,7 +395,8 @@ void Frame::loadNRRDMMapCmd(const char* fn, LayerType ll) } } -void Frame::loadNRRDShareCmd(ShmType stype, int id, const char* fn, LayerType ll) +void Frame::loadNRRDShareCmd(ShmType stype, int id, const char* fn, + LayerType ll) { switch (ll) { case IMG: @@ -444,6 +445,175 @@ void Frame::loadNRRDVarCmd(const char* ch, const char* fn, LayerType ll) } } +// *** Mosaic Image *** + +void Frame::loadMosaicImageAllocCmd(MosaicType type, Coord::CoordSystem sys, + const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageAllocCmd(type, sys, ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicAlloc(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicImage(ALLOC, fn, img, type, sys)); + break; + } + +} + +void Frame::loadMosaicImageAllocGZCmd(MosaicType type, Coord::CoordSystem sys, + const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageAllocGZCmd(type, sys, ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicAllocGZ(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicImage(ALLOCGZ, fn, img, type, sys)); + break; + } + +} + +void Frame::loadMosaicImageChannelCmd(MosaicType type, Coord::CoordSystem sys, + const char* ch, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageChannelCmd(type, sys, ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicChannel(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicImage(CHANNEL, fn, img, type, sys)); + break; + } +} + +void Frame::loadMosaicImageMMapCmd(MosaicType type, Coord::CoordSystem sys, + const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageMMapCmd(type, sys, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicMMap(cc, interp, fn, 1); + loadDone(cc->loadMosaicImage(MMAP, fn, img, type, sys)); + break; + } +} + +void Frame::loadMosaicImageMMapIncrCmd(MosaicType type, Coord::CoordSystem sys, + const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageMMapIncrCmd(type, sys, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicMMapIncr(cc, interp, fn, 1); + loadDone(cc->loadMosaicImage(MMAPINCR, fn, img, type, sys)); + break; + } + +} + +void Frame::loadMosaicImageShareCmd(MosaicType type, Coord::CoordSystem sys, + ShmType stype, int id, const char* fn, + LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageShareCmd(type, sys, stype, id, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicShare(cc, interp, stype, id, fn, 1); + loadDone(cc->loadMosaicImage(SHARE, fn, img, type, sys)); + break; + } + +} + +void Frame::loadMosaicImageSocketCmd(MosaicType type, Coord::CoordSystem sys, + int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageSocketCmd(type, sys, s, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicSocket(cc, interp, + s, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicImage(SOCKET, fn, img, type, sys)); + break; + } +} + +void Frame::loadMosaicImageSocketGZCmd(MosaicType type, Coord::CoordSystem sys, + int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageSocketGZCmd(type, sys, s, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicSocketGZ(cc, interp, + s, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->loadMosaicImage(SOCKETGZ, fn, img, type, sys)); + break; + } +} + +void Frame::loadMosaicImageVarCmd(MosaicType type, Coord::CoordSystem sys, + const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadMosaicImageVarCmd(type, sys, ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageMosaicVar(cc, interp, ch, fn, 1); + loadDone(cc->loadMosaicImage(VAR, fn, img, type, sys)); + break; + } + +} + // Support void Frame::loadDone(int rr) -- cgit v0.12