diff options
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/base.h | 12 | ||||
-rw-r--r-- | tksao/frame/baseload.C | 48 | ||||
-rw-r--r-- | tksao/frame/frame.h | 7 | ||||
-rw-r--r-- | tksao/frame/frameload.C | 103 |
4 files changed, 134 insertions, 36 deletions
diff --git a/tksao/frame/base.h b/tksao/frame/base.h index e56b8dd..a1c4d78 100644 --- a/tksao/frame/base.h +++ b/tksao/frame/base.h @@ -806,12 +806,12 @@ public: void loadENVISMMapCmd(const char*, const char*); - void loadNRRDAllocCmd(const char*, const char*, LayerType); - void loadNRRDChannelCmd(const char*, const char*, LayerType); - void loadNRRDMMapCmd(const char*, LayerType); - void loadNRRDShareCmd(ShmType, int, const char*, LayerType); - void loadNRRDSocketCmd(int, const char*, LayerType); - void loadNRRDVarCmd(const char*, const char*, LayerType); + virtual void loadNRRDAllocCmd(const char*, const char*, LayerType); + virtual void loadNRRDChannelCmd(const char*, const char*, LayerType); + virtual void loadNRRDMMapCmd(const char*, LayerType); + virtual void loadNRRDShareCmd(ShmType, int, const char*, LayerType); + virtual void loadNRRDSocketCmd(int, const char*, LayerType); + virtual void loadNRRDVarCmd(const char*, const char*, LayerType); virtual void loadPhotoCmd(const char*, const char*); virtual void loadSlicePhotoCmd(const char*, const char*); diff --git a/tksao/frame/baseload.C b/tksao/frame/baseload.C index bf40130..2e9fffd 100644 --- a/tksao/frame/baseload.C +++ b/tksao/frame/baseload.C @@ -114,24 +114,21 @@ void Base::loadArrChannelCmd(const char* ch, const char* fn, LayerType ll) { unloadFits(); FitsImage* img = new FitsImageArrChannel(currentContext, interp, - ch, fn, - FitsFile::NOFLUSH, 1); + ch, fn, FitsFile::NOFLUSH, 1); loadDone(currentContext->load(CHANNEL, fn, img)); } void Base::loadArrMMapCmd(const char* fn, LayerType ll) { unloadFits(); - FitsImage* img = new FitsImageArrMMap(currentContext, interp, - fn, 1); + FitsImage* img = new FitsImageArrMMap(currentContext, interp, fn, 1); loadDone(currentContext->load(MMAP, fn, img)); } void Base::loadArrMMapIncrCmd(const char* fn, LayerType ll) { unloadFits(); - FitsImage* img = new FitsImageArrMMapIncr(currentContext, interp, - fn, 1); + FitsImage* img = new FitsImageArrMMapIncr(currentContext, interp, fn, 1); loadDone(currentContext->load(MMAPINCR, fn, img)); } @@ -163,8 +160,7 @@ void Base::loadArrSocketGZCmd(int s, const char* fn, LayerType ll) void Base::loadArrVarCmd(const char* ch, const char* fn, LayerType ll) { unloadFits(); - FitsImage* img = new FitsImageArrVar(currentContext, interp, - ch, fn, 1); + FitsImage* img = new FitsImageArrVar(currentContext, interp, ch, fn, 1); loadDone(currentContext->load(VAR, fn, img)); } @@ -181,57 +177,49 @@ void Base::loadENVISMMapCmd(const char* hdr, const char* fn) void Base::loadNRRDAllocCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageNRRDAlloc(currentContext, interp, ch, fn, FitsFile::NOFLUSH, 1); - loadDone(currentContext->load(ALLOC, fn, img), ll); + loadDone(currentContext->load(ALLOC, fn, img)); } void Base::loadNRRDChannelCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageNRRDChannel(currentContext, interp, - ch, fn, - FitsFile::NOFLUSH, 1); - loadDone(currentContext->load(CHANNEL, fn, img), ll); + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(currentContext->load(CHANNEL, fn, img)); } void Base::loadNRRDMMapCmd(const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageNRRDMMap(currentContext, interp, fn, 1); - loadDone(currentContext->load(MMAP, fn, img), ll); + loadDone(currentContext->load(MMAP, fn, img)); } void Base::loadNRRDShareCmd(ShmType stype, int id, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageNRRDShare(currentContext, interp, stype, id, fn, 1); - loadDone(currentContext->load(SHARE, fn, img), ll); + loadDone(currentContext->load(SHARE, fn, img)); } void Base::loadNRRDSocketCmd(int s, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); + unloadFits(); FitsImage* img = new FitsImageNRRDSocket(currentContext, interp, s, fn, FitsFile::FLUSH, 1); - loadDone(currentContext->load(SOCKET, fn, img), ll); + loadDone(currentContext->load(SOCKET, fn, img)); } void Base::loadNRRDVarCmd(const char* ch, const char* fn, LayerType ll) { - if (ll == IMG) - unloadFits(); - FitsImage* img = new FitsImageNRRDVar(currentContext, interp, - ch, fn, 1); - loadDone(currentContext->load(VAR, fn, img), ll); + unloadFits(); + FitsImage* img = new FitsImageNRRDVar(currentContext, interp, ch, fn, 1); + loadDone(currentContext->load(VAR, fn, img)); } // *** Photo *** diff --git a/tksao/frame/frame.h b/tksao/frame/frame.h index 68fdb48..7d127a3 100644 --- a/tksao/frame/frame.h +++ b/tksao/frame/frame.h @@ -109,6 +109,13 @@ class Frame : public FrameBase { void loadArrSocketCmd(int, const char*, LayerType); void loadArrSocketGZCmd(int, const char*, LayerType); void loadArrVarCmd(const char*, const char*, LayerType); + + void loadNRRDAllocCmd(const char*, const char*, LayerType); + void loadNRRDChannelCmd(const char*, const char*, LayerType); + void loadNRRDMMapCmd(const char*, LayerType); + void loadNRRDShareCmd(ShmType, int, const char*, LayerType); + void loadNRRDSocketCmd(int, const char*, LayerType); + void loadNRRDVarCmd(const char*, const char*, LayerType); }; #endif diff --git a/tksao/frame/frameload.C b/tksao/frame/frameload.C index ff4323b..b3e1b2d 100644 --- a/tksao/frame/frameload.C +++ b/tksao/frame/frameload.C @@ -343,6 +343,109 @@ void Frame::loadArrVarCmd(const char* ch, const char* fn, LayerType ll) } } +// *** NRRD *** + +void Frame::loadNRRDAllocCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDAllocCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDAlloc(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->load(ALLOC, fn, img)); + break; + } +} + +void Frame::loadNRRDChannelCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDChannelCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDChannel(cc, interp, + ch, fn, FitsFile::NOFLUSH, 1); + loadDone(cc->load(CHANNEL, fn, img)); + break; + } +} + +void Frame::loadNRRDMMapCmd(const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDMMapCmd(fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDMMap(cc, interp, fn, 1); + loadDone(cc->load(MMAP, fn, img)); + break; + } +} + +void Frame::loadNRRDShareCmd(ShmType stype, int id, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDShareCmd(stype, id, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDShare(cc, interp, stype, id, fn, 1); + loadDone(cc->load(SHARE, fn, img)); + break; + } +} + +void Frame::loadNRRDSocketCmd(int s, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDSocketCmd(s, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDSocket(cc, interp, + s, fn, FitsFile::FLUSH, 1); + loadDone(cc->load(SOCKET, fn, img)); + break; + } +} + +void Frame::loadNRRDVarCmd(const char* ch, const char* fn, LayerType ll) +{ + switch (ll) { + case IMG: + Base::loadNRRDVarCmd(ch, fn, ll); + break; + case MASK: + FitsMask* msk = new FitsMask(this, maskColorName, maskMark); + mask.append(msk); + Context* cc = msk->context(); + FitsImage* img = new FitsImageNRRDVar(cc, interp, ch, fn, 1); + loadDone(cc->load(VAR, fn, img)); + break; + } +} + +// Support + void Frame::loadDone(int rr) { if (rr) |