Evita  0.16
evField.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evField_h
25 #define __evField_h
26 
27 
28 #include "evVector.h"
29 #include "evAddress.h"
30 #include "evFieldScaleInfo.h"
31 
32 
33 template <class T>
34 class evField : public evDataObject
35 {
36 public:
37  evField(void)
38  {
39  this->Initialize();
40  }
41  virtual ~evField(void)
42  { }
43 
44  virtual const evString GetClassName(void) const
45  {
46  return(evString("evField"));
47  }
48 
49  bool IsAllocated(void) const;
50  bool IsSameSize(const evField &field) const;
51 
52  int Copy(const evField &field);
53 
54  virtual int SetSize(const evAddress &size,
55  const bool allocate = true);
56  virtual int Resize(const evAddress &size,
57  const bool linear = 0);
58 
59  void SetNumScales(const unsigned int num_scales);
60 
61  unsigned int GetNumDimensions(void) const;
62  unsigned int GetSize(const unsigned int index) const;
63  evAddress GetSize(void) const;
64  unsigned int GetTotalSize(void) const;
65  unsigned int GetNumScales(void) const;
66 
67  T GetField(const unsigned int index) const;
68  T GetField(const evAddress &address) const;
69 
70  T &operator [] (const unsigned int index);
71  const T &operator [] (const unsigned int index) const;
72  T &operator [] (const evAddress &address);
73  const T &operator [] (const evAddress &address) const;
74 
75  void PutField(const T &value);
76  void PutField(const T &value, const unsigned int index);
77  void PutField(const T &value, const evAddress &address);
78 
79  void ZeroField(void);
80 
81  int SubtractMean(T &mean);
82  int AddMean(const T mean);
83 
84  double DistortionMSE(const evField &field) const;
85 
86  static unsigned int GetNumSubbands(const unsigned int num_scales,
87  const unsigned int num_dimensions);
88  static unsigned int NumSubbandsToNumScales(const unsigned int num_subbands,
89  const unsigned int
90  num_dimensions);
91  static unsigned int CalcScaleFromSubband(const unsigned int subband,
92  const unsigned int num_scales,
93  const unsigned int num_dimensions);
94  static int SubbandInfo(const unsigned int subband,
95  const unsigned int num_scales,
96  const evAddress &field_size,
97  const evAddress &field_origin,
98  evAddress &subband_size,
99  evAddress &subband_origin,
100  unsigned int &subband_scale);
101 
102  virtual int RasterScan(evField<T> &field,
103  const evAddress &field_origin) const;
104  virtual int InverseRasterScan(evField<T> &field,
105  const evAddress &field_origin) const;
106  virtual int InverseRasterScan(evField<T> &field,
107  const evAddress &field_origin,
108  const evAddress &full_size,
109  const unsigned int max_num_scales) const;
110 
111  virtual int GetScaleInfo(evFieldScaleInfo &scale_info,
112  const evAddress &field_origin) const;
113 
114  virtual int ExtractSubband(const unsigned int subband, evField<T> &field,
115  const evAddress &field_origin) const;
116  int PreserveBaseband(const evAddress &field_origin);
117 
118  virtual void PrintSelf(const int tabbing) const;
119 
120 protected:
121  void Deallocate(void);
122  virtual void Initialize(void);
123  unsigned int NumDimensions;
125  std::vector<T> Field;
126 
127 private:
128  evField(const evField &field);
129 
130  int NullSubband(const evAddress &subband_size) const;
131 
132  unsigned int NumScales;
133  unsigned int NumSubbands;
134 };
135 
136 
139 
140 
141 template <class T>
142 inline void evField<T>::Deallocate(void)
143 {
144  this->Field = std::vector<T>();
145 }
146 
147 
148 void Deallocate(void);
149 template <class T>
150 inline void evField<T>::Initialize(void)
151 {
152  this->Deallocate();
153  this->NumDimensions = 0;
154  this->NumScales = 0;
155  this->NumSubbands = 1;
156 }
157 
158 
159 template <class T>
160 inline bool evField<T>::IsAllocated(void) const
161 {
162  return(!this->Field.empty());
163 }
164 
165 
166 template <class T>
167 inline bool evField<T>::IsSameSize(const evField &field) const
168 {
169  return(this->Size == field.Size);
170 }
171 
172 
173 template <class T>
174 int evField<T>::Copy(const evField<T> &field)
175 {
176  if (!this->IsAllocated())
177  {
178  if (this->SetSize(field.Size))
179  {
180  ErrorHandler.ErrorMessage("evField::Copy(): Error calling evField::SetSize()");
181  return(1);
182  }
183  }
184  else
185  if (!this->IsSameSize(field))
186  {
187  ErrorHandler.ErrorMessage("evField::Copy(): Fields not the same size");
188  return(1);
189  }
190 
191  std::copy(field.Field.begin(),
192  field.Field.end(),
193  this->Field.begin());
194 
195  this->NumScales = field.NumScales;
196  this->NumSubbands = field.NumSubbands;
197 
198  return(0);
199 }
200 
201 
202 template <class T>
204  const bool allocate)
205 {
206  this->Size = size;
207 
208  this->NumDimensions = this->Size.GetNumDimensions();
209 
210  unsigned int total_size = size.Product();
211 
212  T value = 0;
213 
214  this->Deallocate();
215 
216  if (allocate)
217  this->Field.insert(this->Field.begin(), total_size, value);
218 
219  return(0);
220 }
221 
222 
223 template <class T>
225  const bool linear)
226 {
227  if (this->Size == size)
228  return(0);
229 
230  evField<T> old_field;
231  old_field.Copy(*this);
232 
233  this->SetSize(size);
234 
235  if (linear)
236  std::copy(old_field.Field.begin(),
237  old_field.Field.begin() +
238  std::min(this->Field.size(), old_field.Field.size()),
239  this->Field.begin());
240  else
241  {
242  evAddress address(this->Size);
243  address = 0;
244  do
245  {
246  bool inside = true;
247  for (unsigned int dimension = 0; dimension < address.GetNumDimensions();
248  dimension++)
249  if (address[dimension] >= old_field.Size[dimension])
250  inside = false;
251  if (inside)
252  (*this)[address] = old_field[address];
253  }
254  while(!address.Increment(this->Size));
255  }
256 
257  return(0);
258 }
259 
260 
261 template <class T>
262 inline void evField<T>::SetNumScales(const unsigned int num_scales)
263 {
264  this->NumScales = num_scales;
265  this->NumSubbands = this->GetNumSubbands(this->NumScales,
266  this->NumDimensions);
267 }
268 
269 
270 template <class T>
271 inline unsigned int evField<T>::GetNumScales(void) const
272 {
273  return(this->NumScales);
274 }
275 
276 
277 template <class T>
278 inline unsigned int evField<T>::GetNumDimensions(void) const
279 {
280  return(this->NumDimensions);
281 }
282 
283 
284 template <class T>
285 inline unsigned int evField<T>::GetSize(const unsigned int index) const
286 {
287  return(this->Size.Get(index));
288 }
289 
290 
291 template <class T>
292 inline evAddress evField<T>::GetSize(void) const
293 {
294  return(this->Size);
295 }
296 
297 
298 template <class T>
299 inline unsigned int evField<T>::GetTotalSize(void) const
300 {
301  return(this->Field.size());
302 }
303 
304 
305 template <class T>
306 inline T evField<T>::GetField(const unsigned int index) const
307 {
308  return(this->Field[index]);
309 }
310 
311 
312 template <class T>
313 inline T evField<T>::GetField(const evAddress &address) const
314 {
315  unsigned int dimension;
316  unsigned int index;
317 
318  index = 0;
319  for (dimension = this->NumDimensions - 1; dimension >= 1; dimension--)
320  index = (index + address.Get(dimension)) * this->Size.Get(dimension - 1);
321  index += address.Get(0);
322 
323  return(this->Field[index]);
324 }
325 
326 
327 template <class T>
328 inline T &evField<T>::operator [] (const unsigned int index)
329 {
330  return(this->Field[index]);
331 }
332 
333 
334 template <class T>
335 inline const T &evField<T>::operator [] (const unsigned int index) const
336 {
337  return(this->Field[index]);
338 }
339 
340 
341 template <class T>
342 inline T &evField<T>::operator [] (const evAddress &address)
343 {
344  unsigned int dimension;
345  unsigned int index;
346 
347  index = 0;
348  for (dimension = this->NumDimensions - 1; dimension >= 1; dimension--)
349  index = (index + address.Get(dimension)) * this->Size.Get(dimension - 1);
350  index += address.Get(0);
351 
352  return(this->Field[index]);
353 }
354 
355 
356 template <class T>
357 inline const T &evField<T>::operator [] (const evAddress &address) const
358 {
359  unsigned int dimension;
360  unsigned int index;
361 
362  index = 0;
363  for (dimension = this->NumDimensions - 1; dimension >= 1; dimension--)
364  index = (index + address.Get(dimension)) * this->Size.Get(dimension - 1);
365  index += address.Get(0);
366 
367  return(this->Field[index]);
368 }
369 
370 
371 template <class T>
372 inline void evField<T>::PutField(const T &value)
373 {
374  std::fill(this->Field.begin(),
375  this->Field.end(),
376  value);
377 }
378 
379 
380 template <class T>
381 inline void evField<T>::PutField(const T &value, const unsigned int index)
382 {
383  this->Field[index] = value;
384 }
385 
386 
387 template <class T>
388 inline void evField<T>::PutField(const T &value, const evAddress &address)
389 {
390  unsigned int dimension;
391  unsigned int index;
392 
393  for (index = 0, dimension = this->NumDimensions - 1;
394  dimension >= 1;
395  dimension--)
396  index = (index + address.Get(dimension)) * this->Size.Get(dimension - 1);
397  index += address.Get(0);
398 
399  this->Field[index] = value;
400 }
401 
402 
403 template <class T>
404 inline void evField<T>::ZeroField(void)
405 {
406  if (!this->IsAllocated())
407  return;
408 
409  std::fill(this->Field.begin(),
410  this->Field.end(),
411  0);
412 }
413 
414 
415 template <class T>
417 {
418  int index;
419 
420  if (this->GetFieldMean(mean))
421  {
422  ErrorHandler.ErrorMessage("evField::SubtractMean(): Error calling evField::GetFieldMean()");
423  return(1);
424  }
425 
426  for (index = 0; index < this->GetTotalSize(); index++)
427  this->Field[index] = this->Field[index] - mean;
428 
429  return(0);
430 }
431 
432 
433 template <class T>
434 int evField<T>::AddMean(const T mean)
435 {
436  int index;
437 
438  if (!this->IsAllocated())
439  {
440  ErrorHandler.ErrorMessage("evField::AddMean(): Field not allocated");
441  return(1);
442  }
443 
444  for (index = 0; index < this->GetTotalSize(); index++)
445  this->Field[index] = this->Field[index] + mean;
446 
447  return(0);
448 }
449 
450 
451 template <class T>
452 double evField<T>::DistortionMSE(const evField<T> &field) const
453 {
454  int size;
455  int index;
456  T difference;
457  double distortion = 0.0;
458 
459  if (!this->IsSameSize(field))
460  {
461  ErrorHandler.ErrorMessage("evField::DistortionMSE(): Data fields must be of same size and dimension");
462  return(-1.0);
463  }
464 
465  size = this->GetTotalSize();
466 
467  if (!size)
468  return(0.0);
469 
470  for (index = 0; index < size; index++)
471  {
472  difference = this->Field[index] - field.Field[index];
473  distortion += difference * difference;
474  }
475 
476  distortion /= size;
477 
478  return(distortion);
479 }
480 
481 
482 template <class T>
483 unsigned int evField<T>::GetNumSubbands(const unsigned int num_scales,
484  const unsigned int num_dimensions)
485 {
486  int subband_constant;
487 
488  if (num_dimensions == 0)
489  return(0);
490 
491  subband_constant = (1 << num_dimensions) - 1;
492 
493  return(num_scales * subband_constant + 1);
494 }
495 
496 
497 template <class T>
498 unsigned int evField<T>::NumSubbandsToNumScales(const unsigned int
499  num_subbands,
500  const unsigned int
501  num_dimensions)
502 {
503  int subband_constant;
504 
505  if (num_dimensions == 0)
506  return(0);
507 
508  if (num_subbands == 0)
509  return(0);
510 
511  subband_constant = (1 << num_dimensions) - 1;
512 
513  if ((num_subbands - 1) % subband_constant)
514  return(0);
515 
516  return((num_subbands - 1) / subband_constant);
517 }
518 
519 
520 template <class T>
521 unsigned int evField<T>::CalcScaleFromSubband(const unsigned int subband,
522  const unsigned int num_scales,
523  const unsigned int
524  num_dimensions)
525 {
526  int subband_constant;
527 
528  if (num_dimensions == 0)
529  return(0);
530 
531  subband_constant = (1 << num_dimensions) - 1;
532 
533  if (!num_scales)
534  return(0);
535 
536  if (!subband)
537  return(num_scales);
538 
539  return(num_scales - (subband - 1)/subband_constant);
540 }
541 
542 
543 template <class T>
544 int evField<T>::SubbandInfo(const unsigned int subband,
545  const unsigned int num_scales,
546  const evAddress &field_size,
547  const evAddress &field_origin,
548  evAddress &subband_size,
549  evAddress &subband_offset,
550  unsigned int &subband_scale)
551 {
552  unsigned int dimension;
553  unsigned int subband_constant;
554  unsigned int subband_code;
555  unsigned int num_dimensions = field_size.GetNumDimensions();
556  evAddress baseband_size(num_dimensions);
557 
558  baseband_size = 0;
559  subband_size = baseband_size;
560  subband_offset = baseband_size;
561 
562  if (num_dimensions == 0)
563  return(0);
564 
565  subband_constant = (1 << num_dimensions) - 1;
566 
567  subband_scale =
569  num_scales,
570  num_dimensions);
571 
572  for (dimension = 0; dimension < num_dimensions; dimension++)
573  baseband_size[dimension] =
574  QccWAVWaveletDWTSubbandLength(field_size[dimension],
575  subband_scale, 0,
576  field_origin[dimension],
577  0);
578 
579  if (!subband)
580  {
581  for (dimension = 0; dimension < num_dimensions; dimension++)
582  {
583  subband_offset[dimension] = 0;
584  subband_size[dimension] = baseband_size[dimension];
585  }
586  return(0);
587  }
588 
589  subband_code = ((subband - 1) % subband_constant) + 1;
590  for (dimension = 0; dimension < num_dimensions; dimension++)
591  {
592  if (subband_code & 1)
593  {
594  subband_size[dimension] =
595  QccWAVWaveletDWTSubbandLength(field_size[dimension],
596  subband_scale, 1,
597  field_origin[dimension],
598  0);
599  subband_offset[dimension] = baseband_size[dimension];
600  }
601  else
602  {
603  subband_size[dimension] =
604  QccWAVWaveletDWTSubbandLength(field_size[dimension],
605  subband_scale, 0,
606  field_origin[dimension],
607  0);
608  subband_offset[dimension] = 0;
609  }
610  subband_code >>= 1;
611  }
612 
613  return(0);
614 }
615 
616 
617 template <class T>
618 inline int evField<T>::NullSubband(const evAddress &subband_size) const
619 {
620  unsigned int dimension;
621 
622  for (dimension = 0; dimension < subband_size.GetNumDimensions(); dimension++)
623  if (subband_size.Get(dimension) <= 0)
624  return(1);
625 
626  return(0);
627 }
628 
629 
630 template <class T>
632  const evAddress &field_origin) const
633 {
634  evAddress subband_size(this->NumDimensions);
635  evAddress subband_origin(this->NumDimensions);
636  evAddress counter(this->NumDimensions);
637  evAddress address(this->NumDimensions);
638  unsigned int subband_scale;
639 
640  if (!this->IsAllocated())
641  return(0);
642 
643  if (field.GetNumDimensions() != field_origin.GetNumDimensions())
644  {
645  ErrorHandler.ErrorMessage("evField::RasterScan(): field_origin does not mathc field");
646  return(1);
647  }
648 
649  if (field.SetSize(this->Size))
650  {
651  ErrorHandler.ErrorMessage("evField::RasterScan(): Error calling evField::SetSize()");
652  return(1);
653  }
654 
655  unsigned int index;
656  unsigned int subband;
657  for (index = 0, subband = 0;
658  subband < this->NumSubbands; subband++)
659  {
660  if (this->SubbandInfo(subband,
661  this->NumScales,
662  this->Size,
663  field_origin,
664  subband_size,
665  subband_origin,
666  subband_scale))
667  {
668  ErrorHandler.ErrorMessage("evField::RasterScan(): Error calling evField::SubbandInfo()");
669  return(1);
670  }
671 
672  counter = 0;
673  do
674  {
675  address = counter + subband_origin;
676 
677  if (!this->NullSubband(subband_size))
678  field[index++] = (*this)[address];
679  }
680  while (!counter.Increment(subband_size));
681  }
682 
683  return(0);
684 }
685 
686 
687 template <class T>
689  const evAddress &field_origin) const
690 {
691  if (this->InverseRasterScan(field,
692  field_origin,
693  field.Size,
694  field.NumScales))
695  {
696  ErrorHandler.ErrorMessage("evField::InverseRasterScan(): Error calling evField::InverseRasterScan()");
697  return(1);
698  }
699 
700  return(0);
701 }
702 
703 
704 template <class T>
706  const evAddress &field_origin,
707  const evAddress &full_size,
708  const unsigned int max_num_scales) const
709 {
710  unsigned int subband;
711  unsigned int index;
712  evAddress subband_size(field.NumDimensions);
713  evAddress subband_origin(field.NumDimensions);
714  evAddress counter(field.NumDimensions);
715  evAddress address(field.NumDimensions);
716  unsigned int subband_scale;
717 
718  if (!this->IsAllocated())
719  return(0);
720 
721  if (field.GetNumDimensions() != field_origin.GetNumDimensions())
722  {
723  ErrorHandler.ErrorMessage("evField::InverseRasterScan(): field_origin does not match field");
724  return(1);
725  }
726 
727  for (index = 0, subband = 0; subband < field.NumSubbands; subband++)
728  {
729  if (this->SubbandInfo(subband,
730  max_num_scales,
731  full_size,
732  field_origin,
733  subband_size,
734  subband_origin,
735  subband_scale))
736  {
737  ErrorHandler.ErrorMessage("evField::InverseRasterScan(): Error calling evField::SubbandInfo()");
738  return(1);
739  }
740 
741  counter = 0;
742  do
743  {
744  address = counter + subband_origin;
745 
746  if (!field.NullSubband(subband_size))
747  field[address] = (*this)[index++];
748  }
749  while (!counter.Increment(subband_size));
750  }
751 
752  return(0);
753 }
754 
755 
756 template <class T>
758  const evAddress &field_origin) const
759 {
760  evAddress subband_size(this->NumDimensions);
761  evAddress subband_origin(this->NumDimensions);
762  evAddress counter(this->NumDimensions);
763  evAddress address(this->NumDimensions);
764  unsigned int subband_scale;
765  unsigned int subband;
766  unsigned int start;
767  unsigned int length;
768  int scale = 0;
769  int previous_scale = -1;
770 
771  for (subband = 0, start = 0, length = 0;
772  subband < this->NumSubbands; subband++)
773  {
774  if (this->SubbandInfo(subband,
775  this->NumScales,
776  this->Size,
777  field_origin,
778  subband_size,
779  subband_origin,
780  subband_scale))
781  {
782  ErrorHandler.ErrorMessage("evField::RasterScan(): Error calling evField::SubbandInfo()");
783  return(1);
784  }
785 
786  scale = this->CalcScaleFromSubband(subband,
787  this->NumScales,
788  this->Size.GetNumDimensions());
789 
790  if (!subband)
791  {
792  length = subband_size.Product();
793  scale_info.Append(scale + 1, start, length);
794  start = length;
795  length = 0;
796  previous_scale = scale;
797  }
798  else
799  if (scale != previous_scale)
800  {
801  scale_info.Append(previous_scale, start, length);
802 
803  start += length;
804  length = subband_size.Product();
805  previous_scale = scale;
806  }
807  else
808  length += subband_size.Product();
809  }
810 
811  scale_info.Append(scale, start, length);
812 
813  return(0);
814 }
815 
816 
817 template <class T>
818 int evField<T>::ExtractSubband(const unsigned int subband, evField<T> &field,
819  const evAddress &field_origin)
820  const
821 {
822  evAddress subband_size(this->NumDimensions);
823  evAddress subband_origin(this->NumDimensions);
824  evAddress counter(this->NumDimensions);
825  evAddress address(this->NumDimensions);
826  unsigned int subband_scale;
827 
828  if (!this->IsAllocated())
829  return(0);
830 
831  if (this->GetNumDimensions() != field_origin.GetNumDimensions())
832  {
833  ErrorHandler.ErrorMessage("evField::ExtractSubband(): field_origin does not match field");
834  return(1);
835  }
836 
837  if (this->SubbandInfo(subband,
838  this->NumScales,
839  this->Size,
840  field_origin,
841  subband_size,
842  subband_origin,
843  subband_scale))
844  {
845  ErrorHandler.ErrorMessage("evField::ExtractSubband(): Error calling evField::SubbandInfo()");
846  return(1);
847  }
848 
849  if (this->NullSubband(subband_size))
850  return(0);
851 
852  if (field.SetSize(subband_size))
853  {
854  ErrorHandler.ErrorMessage("evField::ExtractSubband(): Error calling evField::SetSize()");
855  return(1);
856  }
857 
858  unsigned int index = 0;
859  counter = 0;
860  do
861  {
862  address = counter + subband_origin;
863 
864  field[index++] = (*this)[address];
865  }
866  while (!counter.Increment(subband_size));
867 
868  field.NumScales = 0;
869  field.NumSubbands = 1;
870 
871  return(0);
872 }
873 
874 
875 template <class T>
876 int evField<T>::PreserveBaseband(const evAddress &field_origin)
877 {
878  unsigned int baseband_scale;
879 
880  if (!this->NumScales)
881  return(0);
882 
883  if (this->GetNumDimensions() != field_origin.GetNumDimensions())
884  {
885  ErrorHandler.ErrorMessage("evField::PreserveBaseband(): field_origin does not mathc field");
886  return(1);
887  }
888 
889  evAddress baseband_size;
890  evAddress baseband_origin;
891 
892  if (this->SubbandInfo(0,
893  this->NumScales,
894  this->Size,
895  field_origin,
896  baseband_size,
897  baseband_origin,
898  baseband_scale))
899  {
900  ErrorHandler.ErrorMessage("evField::PreserveBaseband(): Error calling evField::SubbandInfo()");
901  return(1);
902  }
903 
904  evField<T> baseband;
905  if (this->ExtractSubband(0, baseband))
906  {
907  ErrorHandler.ErrorMessage("evField::PreserveBaseband(): Error calling evField::ExtractSubband()");
908  return(1);
909  }
910 
911  this->SetSize(baseband.Size);
912 
913  this->Copy(baseband);
914 
915  this->NumScales = 0;
916  this->NumSubbands = 1;
917 
918  return(0);
919 }
920 
921 
922 template <class T>
923 void evField<T>::PrintSelf(const int tabbing) const
924 {
925  std::ostream_iterator<T> out(std::cout, " ");
926 
927  if (tabbing != EVPRINT_NOFORMAT)
928  {
929  evPrintWithTab(tabbing + 2, "Size: ");
930  this->Size.Print(EVPRINT_NOFORMAT);
931  }
932 
933  if (tabbing != EVPRINT_NOFORMAT)
934  evPrintWithTab(tabbing + 2, "Field: ");
935  if (this->Field.empty())
936  std::cout << "<NULL>" << std::endl;
937  else
938  std::copy(this->Field.begin(),
939  this->Field.end(),
940  out);
941 
942  if (tabbing != EVPRINT_NOFORMAT)
943  std::cout << std::endl;
944 }
945 
946 
947 #endif
unsigned int GetNumScales(void) const
Definition: evField.h:271
void SetNumScales(const unsigned int num_scales)
Definition: evField.h:262
void Increment(const unsigned int dimension)
Definition: evAddress.h:210
void evPrintWithTab(const int tabbing, const char *format,...)
void PutField(const T &value)
Definition: evField.h:372
void Deallocate(void)
Definition: evField.h:142
static unsigned int NumSubbandsToNumScales(const unsigned int num_subbands, const unsigned int num_dimensions)
Definition: evField.h:498
void Print(const int tabbing) const
Definition: evObject.h:43
T & operator[](const unsigned int index)
Definition: evField.h:328
evField< int > evMapField
Definition: evField.h:137
unsigned int NumSubbands
Definition: evField.h:133
evAddress Size
Definition: evField.h:124
virtual int InverseRasterScan(evField< T > &field, const evAddress &field_origin) const
Definition: evField.h:688
static int SubbandInfo(const unsigned int subband, const unsigned int num_scales, const evAddress &field_size, const evAddress &field_origin, evAddress &subband_size, evAddress &subband_origin, unsigned int &subband_scale)
Definition: evField.h:544
virtual int SetSize(const evAddress &size, const bool allocate=true)
Definition: evField.h:203
Definition: evAddress.h:37
int Copy(const evField &field)
Definition: evField.h:174
void ZeroField(void)
Definition: evField.h:404
virtual int GetScaleInfo(evFieldScaleInfo &scale_info, const evAddress &field_origin) const
Definition: evField.h:757
virtual ~evField(void)
Definition: evField.h:41
static unsigned int GetNumSubbands(const unsigned int num_scales, const unsigned int num_dimensions)
Definition: evField.h:483
Definition: evDataObject.h:31
evAddress GetSize(void) const
Definition: evField.h:292
unsigned int NumScales
Definition: evField.h:132
int * Get(void)
Definition: evAddress.h:124
bool IsSameSize(const evField &field) const
Definition: evField.h:167
std::vector< T > Field
Definition: evField.h:125
T GetField(const unsigned int index) const
Definition: evField.h:306
static unsigned int CalcScaleFromSubband(const unsigned int subband, const unsigned int num_scales, const unsigned int num_dimensions)
Definition: evField.h:521
unsigned int NumDimensions
Definition: evField.h:123
virtual int RasterScan(evField< T > &field, const evAddress &field_origin) const
Definition: evField.h:631
evField< unsigned char > evFlagField
Definition: evField.h:138
virtual void PrintSelf(const int tabbing) const
Definition: evField.h:923
unsigned int GetNumDimensions(void) const
Definition: evField.h:278
int AddMean(const T mean)
Definition: evField.h:434
Definition: evFieldScaleInfo.h:37
virtual void Initialize(void)
Definition: evField.h:150
virtual const evString GetClassName(void) const
Definition: evField.h:44
virtual int ExtractSubband(const unsigned int subband, evField< T > &field, const evAddress &field_origin) const
Definition: evField.h:818
evErrorHandler ErrorHandler
int NullSubband(const evAddress &subband_size) const
Definition: evField.h:618
void Append(const unsigned int scale, const unsigned int start, const unsigned int length)
Definition: evFieldScaleInfo.h:149
Definition: evField.h:34
int SubtractMean(T &mean)
Definition: evField.h:416
#define EVPRINT_NOFORMAT
Definition: evMiscRoutines.h:34
void ErrorMessage(const char *format,...)
int PreserveBaseband(const evAddress &field_origin)
Definition: evField.h:876
unsigned int GetNumDimensions(void) const
Definition: evAddress.h:148
bool IsAllocated(void) const
Definition: evField.h:160
virtual int Resize(const evAddress &size, const bool linear=0)
Definition: evField.h:224
int Product(void) const
Definition: evAddress.h:256
Definition: evString.h:30
evField(void)
Definition: evField.h:37
double DistortionMSE(const evField &field) const
Definition: evField.h:452
unsigned int GetTotalSize(void) const
Definition: evField.h:299