75 #ifndef SLIP_VOLUME_HPP
76 #define SLIP_VOLUME_HPP
98 #include <boost/serialization/access.hpp>
99 #include <boost/serialization/split_member.hpp>
100 #include <boost/serialization/version.hpp>
106 template <
typename T>
109 template <
typename T>
112 template <
typename T>
113 std::ostream& operator<<(std::ostream & out, const slip::Volume<T>& a);
124 bool operator<(const slip::Volume<T>& x,
132 bool operator<=(const slip::Volume<T>& x,
161 template <
typename T>
211 #ifdef ALL_PLANE_ITERATOR3D
216 typedef std::reverse_iterator<iterator1d> reverse_iterator1d;
217 typedef std::reverse_iterator<const_iterator1d> const_reverse_iterator1d;
218 #endif //ALL_PLANE_ITERATOR3D
241 static const std::size_t
DIM = 3;
261 Volume(
const std::size_t d1,
262 const std::size_t d2,
263 const std::size_t d3);
272 Volume(
const std::size_t d1,
273 const std::size_t d2,
274 const std::size_t d3,
283 Volume(
const std::size_t d1,
284 const std::size_t d2,
285 const std::size_t d3,
300 template<
typename InputIterator>
306 matrix_(new slip::
Matrix3d<T>(d1,d2,d3,first,last))
332 void resize(std::size_t d1,
1712 #ifdef ALL_PLANE_ITERATOR3D
2183 #endif //ALL_PLANE_ITERATOR3D
3168 friend std::ostream& operator<< <>(std::ostream & out,
3187 void read_from_images(
const std::string& file_path_name,
3188 const std::size_t from,
3189 const std::size_t to);
3201 void write_to_images(
const std::string& file_path_name,
3202 const std::size_t from,
3203 const std::size_t to )
const;
3215 void read_raw(
const std::string& file_path_name,
3216 const std::size_t
slices,
3217 const std::size_t
rows,
3218 const std::size_t
cols);
3225 void write_raw(
const std::string& file_path_name)
const;
3245 const std::string& title)
const;
3267 const std::string& title,
3268 const std::size_t from,
3269 const std::size_t to)
const;
3307 std::fill_n(this->
begin(),this->
size(),value);
3329 template<
typename InputIterator>
3349 friend bool operator== <>(
const Volume<T>& x,
3358 friend bool operator!= <>(
const Volume<T>& x,
3367 friend bool operator< <>(
const Volume<T>& x,
3376 friend bool operator> <>(
const Volume<T>& x,
3385 friend bool operator<= <>(
const Volume<T>& x,
3394 friend bool operator>= <>(
const Volume<T>& x,
3453 std::string
name()
const;
3613 template<
class Archive>
3614 void save(Archive & ar,
const unsigned int version)
const
3618 template<
class Archive>
3619 void load(Archive & ar,
const unsigned int version)
3623 BOOST_SERIALIZATION_SPLIT_MEMBER();
3660 template<
typename T>
3661 Volume<T>
operator+(
const Volume<T>& M1,
3662 const Volume<T>& M2);
3670 template<
typename T>
3671 Volume<T>
operator+(
const Volume<T>& M1,
3680 template<
typename T>
3682 const Volume<T>& M1);
3692 template<
typename T>
3693 Volume<T>
operator-(
const Volume<T>& M1,
3694 const Volume<T>& M2);
3702 template<
typename T>
3703 Volume<T>
operator-(
const Volume<T>& M1,
3712 template<
typename T>
3714 const Volume<T>& M1);
3724 template<
typename T>
3725 Volume<T>
operator*(
const Volume<T>& M1,
3726 const Volume<T>& M2);
3734 template<
typename T>
3735 Volume<T>
operator*(
const Volume<T>& M1,
3744 template<
typename T>
3746 const Volume<T>& M1);
3756 template<
typename T>
3757 Volume<T>
operator/(
const Volume<T>& M1,
3758 const Volume<T>& M2);
3766 template<
typename T>
3767 Volume<T>
operator/(
const Volume<T>& M1,
3777 template<
typename T>
3778 T&
min(
const Volume<T>& M1);
3786 template<
typename T>
3787 T&
max(
const Volume<T>& M1);
3795 template<
typename T>
3796 Volume<T>
abs(
const Volume<T>& V);
3804 template<
typename T>
3805 Volume<T>
sqrt(
const Volume<T>& V);
3813 template<
typename T>
3814 Volume<T>
cos(
const Volume<T>& V);
3822 template<
typename T>
3823 Volume<T>
acos(
const Volume<T>& V);
3831 template<
typename T>
3832 Volume<T>
sin(
const Volume<T>& V);
3840 template<
typename T>
3841 Volume<T>
asin(
const Volume<T>& V);
3850 template<
typename T>
3851 Volume<T>
tan(
const Volume<T>& V);
3859 template<
typename T>
3860 Volume<T>
atan(
const Volume<T>& V);
3868 template<
typename T>
3869 Volume<T>
exp(
const Volume<T>& V);
3877 template<
typename T>
3878 Volume<T>
log(
const Volume<T>& V);
3886 template<
typename T>
3887 Volume<T>
cosh(
const Volume<T>& V);
3895 template<
typename T>
3896 Volume<T>
sinh(
const Volume<T>& V);
3904 template<
typename T>
3905 Volume<T>
tanh(
const Volume<T>& V);
3913 template<
typename T>
3914 Volume<T>
log10(
const Volume<T>& V);
3926 template<
typename T>
3932 template<
typename T>
3937 matrix_(new slip::
Matrix3d<T>(d1,d2,d3))
3940 template<
typename T>
3946 matrix_(new slip::
Matrix3d<T>(d1,d2,d3,val))
3949 template<
typename T>
3955 matrix_(new slip::
Matrix3d<T>(d1,d2,d3,val))
3959 template<
typename T>
3962 matrix_(new slip::
Matrix3d<T>((*rhs.matrix_)))
3965 template<
typename T>
3978 template<
typename T>
3984 *matrix_ = *(rhs.matrix_);
3989 template<
typename T>
3993 std::fill_n((*matrix_)[0][0],matrix_->size(),value);
3997 template<
typename T>
4004 matrix_->resize(d1,d2,d3,val);
4021 template<
typename T>
4025 return matrix_->begin();
4028 template<
typename T>
4032 return matrix_->end();
4035 template<
typename T>
4043 template<
typename T>
4052 template<
typename T>
4059 template<
typename T>
4066 template<
typename T>
4073 template<
typename T>
4082 template<
typename T>
4088 return matrix_->slice_begin(row,col);
4091 template<
typename T>
4093 typename Volume<T>::const_slice_iterator
4095 const typename Volume<T>::size_type col)
const
4097 Matrix3d<T>
const * tp(matrix_);
4098 return tp->slice_begin(row,col);
4101 template<
typename T>
4103 typename Volume<T>::slice_iterator
4105 const typename Volume<T>::size_type col)
4107 return matrix_->slice_end(row,col);
4110 template<
typename T>
4112 typename Volume<T>::const_slice_iterator
4114 const typename Volume<T>::size_type col)
const
4116 Matrix3d<T>
const * tp(matrix_);
4117 return tp->slice_end(row,col);
4121 template<
typename T>
4123 typename Volume<T>::reverse_slice_iterator
4125 const typename Volume<T>::size_type col)
4127 return matrix_->slice_rbegin(row,col);
4130 template<
typename T>
4132 typename Volume<T>::const_reverse_slice_iterator
4134 const typename Volume<T>::size_type col)
const
4136 Matrix3d<T>
const * tp(matrix_);
4137 return tp->slice_rbegin(row,col);
4140 template<
typename T>
4142 typename Volume<T>::reverse_slice_iterator
4144 const typename Volume<T>::size_type col)
4146 return matrix_->slice_rend(row,col);
4150 template<
typename T>
4152 typename Volume<T>::const_reverse_slice_iterator
4154 const typename Volume<T>::size_type col)
const
4156 Matrix3d<T>
const * tp(matrix_);
4157 return tp->slice_rend(row,col);
4163 template<
typename T>
4165 typename Volume<T>::row_iterator
4167 const typename Volume<T>::size_type row)
4169 return matrix_->row_begin(slice,row);
4172 template<
typename T>
4174 typename Volume<T>::const_row_iterator
4176 const typename Volume<T>::size_type row)
const
4178 Matrix3d<T>
const * tp(matrix_);
4179 return tp->row_begin(slice,row);
4182 template<
typename T>
4184 typename Volume<T>::row_iterator
4186 const typename Volume<T>::size_type row)
4188 return matrix_->row_end(slice,row);
4191 template<
typename T>
4193 typename Volume<T>::const_row_iterator
4195 const typename Volume<T>::size_type row)
const
4197 Matrix3d<T>
const * tp(matrix_);
4198 return tp->row_end(slice,row);
4202 template<
typename T>
4204 typename Volume<T>::reverse_row_iterator
4206 const typename Volume<T>::size_type row)
4208 return matrix_->row_rbegin(slice,row);
4211 template<
typename T>
4213 typename Volume<T>::const_reverse_row_iterator
4215 const typename Volume<T>::size_type row)
const
4217 Matrix3d<T>
const * tp(matrix_);
4218 return tp->row_rbegin(slice,row);
4222 template<
typename T>
4224 typename Volume<T>::reverse_row_iterator
4226 const typename Volume<T>::size_type row)
4228 return matrix_->row_rend(slice,row);
4231 template<
typename T>
4233 typename Volume<T>::const_reverse_row_iterator
4235 const typename Volume<T>::size_type row)
const
4237 Matrix3d<T>
const * tp(matrix_);
4238 return tp->row_rend(slice,row);
4243 template<
typename T>
4245 typename Volume<T>::col_iterator
4247 const typename Volume<T>::size_type col)
4249 return matrix_->col_begin(slice,col);
4252 template<
typename T>
4254 typename Volume<T>::const_col_iterator
4256 const typename Volume<T>::size_type col)
const
4258 Matrix3d<T>
const * tp(matrix_);
4259 return tp->col_begin(slice,col);
4263 template<
typename T>
4265 typename Volume<T>::col_iterator
4267 const typename Volume<T>::size_type col)
4269 return matrix_->col_end(slice,col);
4272 template<
typename T>
4274 typename Volume<T>::const_col_iterator
4276 const typename Volume<T>::size_type col)
const
4278 Matrix3d<T>
const * tp(matrix_);
4279 return tp->col_end(slice,col);
4283 template<
typename T>
4285 typename Volume<T>::reverse_col_iterator
4287 const typename Volume<T>::size_type col)
4289 return matrix_->col_rbegin(slice,col);
4292 template<
typename T>
4294 typename Volume<T>::const_reverse_col_iterator
4296 const typename Volume<T>::size_type col)
const
4298 Matrix3d<T>
const * tp(matrix_);
4299 return tp->col_rbegin(slice,col);
4303 template<
typename T>
4305 typename Volume<T>::reverse_col_iterator
4307 const typename Volume<T>::size_type col)
4309 return matrix_->col_rend(slice,col);
4312 template<
typename T>
4314 typename Volume<T>::const_reverse_col_iterator
4316 const typename Volume<T>::size_type col)
const
4318 Matrix3d<T>
const * tp(matrix_);
4319 return tp->col_rend(slice,col);
4324 template<
typename T>
4326 typename Volume<T>::slice_range_iterator
4328 const typename Volume<T>::size_type col,
4331 return matrix_->slice_begin(row,col,range);
4334 template<
typename T>
4336 typename Volume<T>::const_slice_range_iterator
4338 const typename Volume<T>::size_type col,
4341 Matrix3d<T>
const * tp(matrix_);
4342 return tp->slice_begin(row,col,range);
4345 template<
typename T>
4347 typename Volume<T>::slice_range_iterator
4349 const typename Volume<T>::size_type col,
4352 return matrix_->slice_end(row,col,range);
4355 template<
typename T>
4357 typename Volume<T>::const_slice_range_iterator
4359 const typename Volume<T>::size_type col,
4362 Matrix3d<T>
const * tp(matrix_);
4363 return tp->slice_end(row,col,range);
4366 template<
typename T>
4368 typename Volume<T>::reverse_slice_range_iterator
4370 const typename Volume<T>::size_type col,
4373 return matrix_->slice_rbegin(row,col,range);
4376 template<
typename T>
4378 typename Volume<T>::const_reverse_slice_range_iterator
4380 const typename Volume<T>::size_type col,
4383 Matrix3d<T>
const * tp(matrix_);
4384 return tp->slice_rbegin(row,col,range);
4387 template<
typename T>
4389 typename Volume<T>::reverse_slice_range_iterator
4391 const typename Volume<T>::size_type col,
4394 return matrix_->slice_rend(row,col,range);
4397 template<
typename T>
4399 typename Volume<T>::const_reverse_slice_range_iterator
4401 const typename Volume<T>::size_type col,
4404 Matrix3d<T>
const * tp(matrix_);
4405 return tp->slice_rend(row,col,range);
4410 template<
typename T>
4412 typename Volume<T>::row_range_iterator
4414 const typename Volume<T>::size_type row,
4417 return matrix_->row_begin(slice,row,range);
4420 template<
typename T>
4422 typename Volume<T>::const_row_range_iterator
4424 const typename Volume<T>::size_type row,
4427 Matrix3d<T>
const * tp(matrix_);
4428 return tp->row_begin(slice,row,range);
4431 template<
typename T>
4433 typename Volume<T>::row_range_iterator
4435 const typename Volume<T>::size_type row,
4438 return matrix_->row_end(slice,row,range);
4441 template<
typename T>
4443 typename Volume<T>::const_row_range_iterator
4445 const typename Volume<T>::size_type row,
4448 Matrix3d<T>
const * tp(matrix_);
4449 return tp->row_end(slice,row,range);
4452 template<
typename T>
4454 typename Volume<T>::reverse_row_range_iterator
4456 const typename Volume<T>::size_type row,
4459 return matrix_->row_rbegin(slice,row,range);
4462 template<
typename T>
4464 typename Volume<T>::const_reverse_row_range_iterator
4466 const typename Volume<T>::size_type row,
4469 Matrix3d<T>
const * tp(matrix_);
4470 return tp->row_rbegin(slice,row,range);
4473 template<
typename T>
4475 typename Volume<T>::reverse_row_range_iterator
4477 const typename Volume<T>::size_type row,
4480 return matrix_->row_rend(slice,row,range);
4483 template<
typename T>
4485 typename Volume<T>::const_reverse_row_range_iterator
4487 const typename Volume<T>::size_type row,
4490 Matrix3d<T>
const * tp(matrix_);
4491 return tp->row_rend(slice,row,range);
4496 template<
typename T>
4498 typename Volume<T>::col_range_iterator
4500 const typename Volume<T>::size_type col,
4503 return matrix_->col_begin(slice,col,range);
4506 template<
typename T>
4508 typename Volume<T>::const_col_range_iterator
4510 const typename Volume<T>::size_type col,
4513 Matrix3d<T>
const * tp(matrix_);
4514 return tp->col_begin(slice,col,range);
4517 template<
typename T>
4519 typename Volume<T>::col_range_iterator
4521 const typename Volume<T>::size_type col,
4524 return matrix_->col_end(slice,col,range);
4527 template<
typename T>
4529 typename Volume<T>::const_col_range_iterator
4531 const typename Volume<T>::size_type col,
4534 Matrix3d<T>
const * tp(matrix_);
4535 return tp->col_end(slice,col,range);
4538 template<
typename T>
4540 typename Volume<T>::reverse_col_range_iterator
4542 const typename Volume<T>::size_type col,
4545 return matrix_->col_rbegin(slice,col,range);
4548 template<
typename T>
4550 typename Volume<T>::const_reverse_col_range_iterator
4552 const typename Volume<T>::size_type col,
4555 Matrix3d<T>
const * tp(matrix_);
4556 return tp->col_rbegin(slice,col,range);
4559 template<
typename T>
4561 typename Volume<T>::reverse_col_range_iterator
4563 const typename Volume<T>::size_type col,
4566 return matrix_->col_rend(slice,col,range);
4569 template<
typename T>
4571 typename Volume<T>::const_reverse_col_range_iterator
4573 const typename Volume<T>::size_type col,
4576 Matrix3d<T>
const * tp(matrix_);
4577 return tp->col_rend(slice,col,range);
4582 template<
typename T>
4584 typename Volume<T>::iterator
4587 return matrix_->plane_begin(slice);
4590 template<
typename T>
4592 typename Volume<T>::const_iterator
4595 Matrix3d<T>
const * tp(matrix_);
4596 return tp->plane_begin(slice);
4599 template<
typename T>
4601 typename Volume<T>::iterator
4604 return matrix_->plane_end(slice);
4607 template<
typename T>
4609 typename Volume<T>::const_iterator
4612 Matrix3d<T>
const * tp(matrix_);
4613 return tp->plane_end(slice);
4616 template<
typename T>
4618 typename Volume<T>::reverse_iterator
4621 return matrix_->plane_rbegin(slice);
4624 template<
typename T>
4626 typename Volume<T>::const_reverse_iterator
4629 Matrix3d<T>
const * tp(matrix_);
4630 return tp->plane_rbegin(slice);
4633 template<
typename T>
4635 typename Volume<T>::reverse_iterator
4638 return matrix_->plane_rend(slice);
4641 template<
typename T>
4643 typename Volume<T>::const_reverse_iterator
4646 Matrix3d<T>
const * tp(matrix_);
4647 return tp->plane_rend(slice);
4650 #ifdef ALL_PLANE_ITERATOR3D
4655 template<
typename T>
4657 typename Volume<T>::iterator1d
4658 Volume<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4659 const typename Volume<T>::size_type row)
4661 return matrix_->plane_row_begin(P,plane_coordinate,row);
4664 template<
typename T>
4666 typename Volume<T>::const_iterator1d
4667 Volume<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4668 const typename Volume<T>::size_type row)
const
4670 Matrix3d<T>
const * tp(matrix_);
4671 return tp->plane_row_begin(P,plane_coordinate,row);
4674 template<
typename T>
4676 typename Volume<T>::iterator1d
4677 Volume<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4678 const typename Volume<T>::size_type row)
4680 return matrix_->plane_row_end(P,plane_coordinate,row);
4683 template<
typename T>
4685 typename Volume<T>::const_iterator1d
4686 Volume<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4687 const typename Volume<T>::size_type row)
const
4689 Matrix3d<T>
const * tp(matrix_);
4690 return tp->plane_row_end(P,plane_coordinate,row);
4693 template<
typename T>
4695 typename Volume<T>::reverse_iterator1d
4696 Volume<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4697 const typename Volume<T>::size_type row)
4699 return matrix_->plane_row_rbegin(P,plane_coordinate,row);
4702 template<
typename T>
4704 typename Volume<T>::const_reverse_iterator1d
4705 Volume<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4706 const typename Volume<T>::size_type row)
const
4708 Matrix3d<T>
const * tp(matrix_);
4709 return tp->plane_row_rbegin(P,plane_coordinate,row);
4712 template<
typename T>
4714 typename Volume<T>::reverse_iterator1d
4715 Volume<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4716 const typename Volume<T>::size_type row)
4718 return matrix_->plane_row_rend(P,plane_coordinate,row);
4721 template<
typename T>
4723 typename Volume<T>::const_reverse_iterator1d
4724 Volume<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4725 const typename Volume<T>::size_type row)
const
4727 Matrix3d<T>
const * tp(matrix_);
4728 return tp->plane_row_rend(P,plane_coordinate,row);
4731 template<
typename T>
4733 typename Volume<T>::iterator1d
4734 Volume<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4735 const typename Volume<T>::size_type col)
4737 return matrix_->plane_col_begin(P,plane_coordinate,col);
4740 template<
typename T>
4742 typename Volume<T>::const_iterator1d
4743 Volume<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4744 const typename Volume<T>::size_type col)
const
4746 Matrix3d<T>
const * tp(matrix_);
4747 return tp->plane_col_begin(P,plane_coordinate,col);
4750 template<
typename T>
4752 typename Volume<T>::iterator1d
4753 Volume<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4754 const typename Volume<T>::size_type col)
4756 return matrix_->plane_col_end(P,plane_coordinate,col);
4759 template<
typename T>
4761 typename Volume<T>::const_iterator1d
4762 Volume<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4763 const typename Volume<T>::size_type col)
const
4765 Matrix3d<T>
const * tp(matrix_);
4766 return tp->plane_col_end(P,plane_coordinate,col);
4769 template<
typename T>
4771 typename Volume<T>::reverse_iterator1d
4772 Volume<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4773 const typename Volume<T>::size_type col)
4775 return matrix_->plane_col_rbegin(P,plane_coordinate,col);
4778 template<
typename T>
4780 typename Volume<T>::const_reverse_iterator1d
4781 Volume<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4782 const typename Volume<T>::size_type col)
const
4784 Matrix3d<T>
const * tp(matrix_);
4785 return tp->plane_col_rbegin(P,plane_coordinate,col);
4788 template<
typename T>
4790 typename Volume<T>::reverse_iterator1d
4791 Volume<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4792 const typename Volume<T>::size_type col)
4794 return matrix_->plane_col_rend(P,plane_coordinate,col);
4797 template<
typename T>
4799 typename Volume<T>::const_reverse_iterator1d
4800 Volume<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4801 const typename Volume<T>::size_type col)
const
4803 Matrix3d<T>
const * tp(matrix_);
4804 return tp->plane_col_rend(P,plane_coordinate,col);
4809 template<
typename T>
4811 typename Volume<T>::const_iterator1d
4812 Volume<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4813 const size_type row,
const Box2d<int> & b)
const
4815 Matrix3d<T>
const * tp(matrix_);
4816 return tp->plane_row_begin(P,plane_coordinate,row,b);
4819 template<
typename T>
4821 typename Volume<T>::iterator1d
4822 Volume<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4823 const size_type row,
const Box2d<int> & b)
4825 return matrix_->plane_row_begin(P,plane_coordinate,row,b);
4828 template<
typename T>
4830 typename Volume<T>::iterator1d
4831 Volume<T>:: plane_row_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4832 const size_type row,
const Box2d<int> & b)
4834 return matrix_->plane_row_end(P,plane_coordinate,row,b);
4837 template<
typename T>
4839 typename Volume<T>::const_iterator1d
4840 Volume<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4841 const size_type row,
const Box2d<int> & b)
const
4843 Matrix3d<T>
const * tp(matrix_);
4844 return tp->plane_row_end(P,plane_coordinate,row,b);
4847 template<
typename T>
4849 typename Volume<T>::reverse_iterator1d
4850 Volume<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4851 const size_type row,
const Box2d<int> & b)
4853 return matrix_->plane_row_rbegin(P,plane_coordinate,row,b);
4856 template<
typename T>
4858 typename Volume<T>::const_reverse_iterator1d
4859 Volume<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4860 const size_type row,
const Box2d<int> & b)
const
4862 Matrix3d<T>
const * tp(matrix_);
4863 return tp->plane_row_rbegin(P,plane_coordinate,row,b);
4866 template<
typename T>
4868 typename Volume<T>::reverse_iterator1d
4869 Volume<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4870 const size_type row,
const Box2d<int> & b)
4872 return matrix_->plane_row_rend(P,plane_coordinate,row,b);
4875 template<
typename T>
4877 typename Volume<T>::const_reverse_iterator1d
4878 Volume<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4879 const size_type row,
const Box2d<int> & b)
const
4881 Matrix3d<T>
const * tp(matrix_);
4882 return tp->plane_row_rend(P,plane_coordinate,row,b);
4885 template<
typename T>
4887 typename Volume<T>::iterator1d
4888 Volume<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4889 const size_type col,
const Box2d<int> & b)
4891 return matrix_->plane_col_begin(P,plane_coordinate,col,b);
4894 template<
typename T>
4896 typename Volume<T>::const_iterator1d
4897 Volume<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4898 const size_type col,
const Box2d<int> & b)
const
4900 Matrix3d<T>
const * tp(matrix_);
4901 return tp->plane_col_begin(P,plane_coordinate,col,b);
4904 template<
typename T>
4906 typename Volume<T>::iterator1d
4907 Volume<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4908 const size_type col,
const Box2d<int> & b)
4910 return matrix_->plane_col_end(P,plane_coordinate,col,b);
4913 template<
typename T>
4915 typename Volume<T>::const_iterator1d
4916 Volume<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4917 const size_type col,
const Box2d<int> & b)
const
4919 Matrix3d<T>
const * tp(matrix_);
4920 return tp->plane_col_end(P,plane_coordinate,col,b);
4923 template<
typename T>
4925 typename Volume<T>::reverse_iterator1d
4926 Volume<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4927 const size_type col,
const Box2d<int> & b)
4929 return matrix_->plane_col_rbegin(P,plane_coordinate,col,b);
4932 template<
typename T>
4934 typename Volume<T>::const_reverse_iterator1d
4935 Volume<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4936 const size_type col,
const Box2d<int> & b)
const
4938 Matrix3d<T>
const * tp(matrix_);
4939 return tp->plane_col_rbegin(P,plane_coordinate,col,b);
4942 template<
typename T>
4944 typename Volume<T>::reverse_iterator1d
4945 Volume<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4946 const size_type col,
const Box2d<int> & b)
4948 return matrix_->plane_col_rend(P,plane_coordinate,col,b);
4951 template<
typename T>
4953 typename Volume<T>::const_reverse_iterator1d
4954 Volume<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Volume<T>::size_type plane_coordinate,
4955 const size_type col,
const Box2d<int> & b)
const
4957 Matrix3d<T>
const * tp(matrix_);
4958 return tp->plane_col_rend(P,plane_coordinate,col,b);
4961 #endif //ALL_PLANE_ITERATOR3D
4969 template<
typename T>
4971 typename Volume<T>::iterator2d
4974 return matrix_->plane_upper_left(P,plane_coordinate);
4977 template<
typename T>
4979 typename Volume<T>::iterator2d
4982 return matrix_->plane_bottom_right(P,plane_coordinate);
4985 template<
typename T>
4987 typename Volume<T>::const_iterator2d
4990 Matrix3d<T>
const * tp(matrix_);
4991 return tp->plane_upper_left(P,plane_coordinate);
4994 template<
typename T>
4996 typename Volume<T>::const_iterator2d
4999 Matrix3d<T>
const * tp(matrix_);
5000 return tp->plane_bottom_right(P,plane_coordinate);
5003 template<
typename T>
5005 typename Volume<T>::reverse_iterator2d
5008 return matrix_->plane_rupper_left(P,plane_coordinate);
5011 template<
typename T>
5013 typename Volume<T>::reverse_iterator2d
5016 return matrix_->plane_rbottom_right(P,plane_coordinate);
5019 template<
typename T>
5021 typename Volume<T>::const_reverse_iterator2d
5024 Matrix3d<T>
const * tp(matrix_);
5025 return tp->plane_rupper_left(P,plane_coordinate);
5028 template<
typename T>
5030 typename Volume<T>::const_reverse_iterator2d
5033 Matrix3d<T>
const * tp(matrix_);
5034 return tp->plane_rbottom_right(P,plane_coordinate);
5039 template<
typename T>
5041 typename Volume<T>::iterator2d
5044 return matrix_->plane_upper_left(P,plane_coordinate,b);
5047 template<
typename T>
5049 typename Volume<T>::iterator2d
5052 return matrix_->plane_bottom_right(P,plane_coordinate,b);
5055 template<
typename T>
5057 typename Volume<T>::const_iterator2d
5060 Matrix3d<T>
const * tp(matrix_);
5061 return tp->plane_upper_left(P,plane_coordinate,b);
5064 template<
typename T>
5066 typename Volume<T>::const_iterator2d
5069 Matrix3d<T>
const * tp(matrix_);
5070 return tp->plane_bottom_right(P,plane_coordinate,b);
5073 template<
typename T>
5075 typename Volume<T>::reverse_iterator2d
5078 return matrix_->plane_rupper_left(P,plane_coordinate,b);
5081 template<
typename T>
5083 typename Volume<T>::reverse_iterator2d
5086 return matrix_->plane_rbottom_right(P,plane_coordinate,b);
5089 template<
typename T>
5091 typename Volume<T>::const_reverse_iterator2d
5094 Matrix3d<T>
const * tp(matrix_);
5095 return tp->plane_rupper_left(P,plane_coordinate,b);
5098 template<
typename T>
5100 typename Volume<T>::const_reverse_iterator2d
5103 Matrix3d<T>
const * tp(matrix_);
5104 return tp->plane_rbottom_right(P,plane_coordinate,b);
5113 template<
typename T>
5117 return matrix_->front_upper_left();
5120 template<
typename T>
5128 template<
typename T>
5132 return matrix_->back_bottom_right();
5135 template<
typename T>
5143 template<
typename T>
5148 return matrix_->rback_bottom_right();
5151 template<
typename T>
5160 template<
typename T>
5165 return matrix_->rfront_upper_left();
5168 template<
typename T>
5179 template<
typename T>
5183 return matrix_->front_upper_left(box);
5186 template<
typename T>
5195 template<
typename T>
5200 return matrix_->back_bottom_right(box);
5203 template<
typename T>
5212 template<
typename T>
5217 return matrix_->rback_bottom_right(box);
5220 template<
typename T>
5229 template<
typename T>
5234 return matrix_->rfront_upper_left(box);
5237 template<
typename T>
5248 template<
typename T>
5255 return matrix_->front_upper_left(slice_range,row_range,col_range);
5258 template<
typename T>
5265 return matrix_->back_bottom_right(slice_range,row_range,col_range);
5269 template<
typename T>
5281 template<
typename T>
5292 template<
typename T>
5299 return matrix_->rfront_upper_left(slice_range,row_range,col_range);
5302 template<
typename T>
5313 template<
typename T>
5320 return matrix_->rback_bottom_right(slice_range,row_range,col_range);
5323 template<
typename T>
5340 template <
typename T>
5342 std::ostream& operator<<(std::ostream & out, const Volume<T>& a)
5352 void Volume<double>::read_from_images(
const std::string& file_path_name,
5353 const std::size_t from,
5354 const std::size_t to)
5357 slip::read_from_images_double(file_path_name,from,to,*
this);
5412 void Volume<float>::read_from_images(
const std::string& file_path_name,
5413 const std::size_t from,
5414 const std::size_t to)
5416 slip::read_from_images_float(file_path_name,from,to,*
this);
5422 void Volume<long>::read_from_images(
const std::string& file_path_name,
5423 const std::size_t from,
5424 const std::size_t to)
5426 slip::read_from_images_long(file_path_name,from,to,*
this);
5432 void Volume<int>::read_from_images(
const std::string& file_path_name,
5433 const std::size_t from,
5434 const std::size_t to)
5436 slip::read_from_images_int(file_path_name,from,to,*
this);
5442 void Volume<short>::read_from_images(
const std::string& file_path_name,
5443 const std::size_t from,
5444 const std::size_t to)
5446 slip::read_from_images_short(file_path_name,from,to,*
this);
5452 void Volume<unsigned char>::read_from_images(
const std::string& file_path_name,
5453 const std::size_t from,
5454 const std::size_t to)
5456 slip::read_from_images_char(file_path_name,from,to,*
this);
5462 void Volume<double>::write_to_images(
const std::string& file_path_name,
5463 const std::size_t from,
5464 const std::size_t to)
const
5467 std::vector<slip::Volume<double>::const_iterator> planes((to - from) + 1);
5468 for(std::size_t i = from; i <= to; ++i)
5470 planes[i-from] = this->plane_begin(i);
5472 slip::write_to_images_double(file_path_name,from,to,this->cols(),this->rows(),planes);
5478 void Volume<float>::write_to_images(
const std::string& file_path_name,
5479 const std::size_t from,
5480 const std::size_t to)
const
5482 std::vector<slip::Volume<float>::const_iterator> planes((to - from) + 1);
5483 for(std::size_t i = from; i <= to; ++i)
5485 planes[i-from] = this->plane_begin(i);
5487 slip::write_to_images_float(file_path_name,from,to,this->cols(),this->rows(),planes);
5492 void Volume<long>::write_to_images(
const std::string& file_path_name,
5493 const std::size_t from,
5494 const std::size_t to)
const
5496 std::vector<slip::Volume<long>::const_iterator> planes((to - from) + 1);
5497 for(std::size_t i = from; i <= to; ++i)
5499 planes[i-from] = this->plane_begin(i);
5501 slip::write_to_images_long(file_path_name,from,to,this->cols(),this->rows(),planes);
5506 void Volume<int>::write_to_images(
const std::string& file_path_name,
5507 const std::size_t from,
5508 const std::size_t to)
const
5510 std::vector<slip::Volume<int>::const_iterator> planes((to - from) + 1);
5511 for(std::size_t i = from; i <= to; ++i)
5513 planes[i-from] = this->plane_begin(i);
5515 slip::write_to_images_int(file_path_name,from,to,this->cols(),this->rows(),planes);
5521 void Volume<short>::write_to_images(
const std::string& file_path_name,
5522 const std::size_t from,
5523 const std::size_t to)
const
5525 std::vector<slip::Volume<short>::const_iterator> planes((to - from) + 1);
5526 for(std::size_t i = from; i <= to; ++i)
5528 planes[i-from] = this->plane_begin(i);
5530 slip::write_to_images_short(file_path_name,from,to,this->cols(),this->rows(),planes);
5536 void Volume<unsigned char>::write_to_images(
const std::string& file_path_name,
5537 const std::size_t from,
5538 const std::size_t to)
const
5540 std::vector<slip::Volume<unsigned char>::const_iterator> planes((to - from) + 1);
5541 for(std::size_t i = from; i <= to; ++i)
5543 planes[i-from] = this->plane_begin(i);
5545 slip::write_to_images_char(file_path_name,from,to,this->cols(),this->rows(),planes);
5548 #endif //HAVE_MAGICK
5550 template<
typename T>
5553 const std::size_t slices,
5554 const std::size_t rows,
5555 const std::size_t cols)
5557 matrix_->resize(slices,rows,cols,0);
5562 template<
typename T>
5569 template<
typename T>
5572 const std::string& title)
const
5577 template<
typename T>
5580 const std::string& title,
5581 const std::size_t from,
5582 const std::size_t to)
const
5592 template<
typename T>
5597 return (*matrix_)[k];
5600 template<
typename T>
5605 return (*matrix_)[k];
5608 template<
typename T>
5610 typename Volume<T>::reference
5612 const typename Volume<T>::size_type i,
5613 const typename Volume<T>::size_type j)
5615 return (*matrix_)[k][i][j];
5618 template<
typename T>
5620 typename Volume<T>::const_reference
5622 const typename Volume<T>::size_type i,
5623 const typename Volume<T>::size_type j)
const
5625 return (*matrix_)[k][i][j];
5630 template<
typename T>
5636 template<
typename T>
5641 template<
typename T>
5646 template<
typename T>
5651 template<
typename T>
5656 template<
typename T>
5661 template<
typename T>
5666 template<
typename T>
5672 template<
typename T>
5677 template<
typename T>
5682 template<
typename T>
5688 template<
typename T>
5692 template<
typename T>
5696 matrix_->swap(*(M.matrix_));
5702 template<
typename T>
5711 template<
typename T>
5723 template<
typename T>
5725 bool operator<(const Volume<T>& x,
5728 return std::lexicographical_compare(x.begin(), x.end(),
5729 y.begin(), y.end());
5733 template<
typename T>
5741 template<
typename T>
5743 bool operator<=(const Volume<T>& x,
5749 template<
typename T>
5763 template<
typename T>
5767 std::transform(matrix_->begin(),matrix_->end(),matrix_->begin(),std::bind2nd(std::plus<T>(),val));
5771 template<
typename T>
5775 std::transform(matrix_->begin(),matrix_->end(),matrix_->begin(),std::bind2nd(std::minus<T>(),val));
5779 template<
typename T>
5783 std::transform(matrix_->begin(),matrix_->end(),matrix_->begin(),std::bind2nd(std::multiplies<T>(),val));
5787 template<
typename T>
5791 std::transform(matrix_->begin(),matrix_->end(),matrix_->begin(),std::bind2nd(std::multiplies<T>(),T(1)/val));
5795 template<
typename T>
5800 std::transform(matrix_->begin(),matrix_->end(),tmp.
begin(),std::negate<T>());
5804 template<
typename T>
5808 assert(this->dim1() == rhs.
dim1());
5809 assert(this->dim2() == rhs.
dim2());
5810 assert(this->dim3() == rhs.
dim3());
5812 std::transform(matrix_->begin(),matrix_->end(),(*(rhs.matrix_)).begin(),matrix_->begin(),std::plus<T>());
5816 template<
typename T>
5820 assert(this->dim1() == rhs.
dim1());
5821 assert(this->dim2() == rhs.
dim2());
5822 assert(this->dim3() == rhs.
dim3());
5823 std::transform(matrix_->begin(),matrix_->end(),(*(rhs.matrix_)).begin(),matrix_->begin(),std::minus<T>());
5827 template<
typename T>
5831 assert(this->dim1() == rhs.
dim1());
5832 assert(this->dim2() == rhs.
dim2());
5833 assert(this->dim3() == rhs.
dim3());
5834 std::transform(matrix_->begin(),matrix_->end(),(*(rhs.matrix_)).begin(),matrix_->begin(),std::multiplies<T>());
5838 template<
typename T>
5842 assert(this->size() == rhs.
size());
5843 std::transform(matrix_->begin(),matrix_->end(),(*(rhs.matrix_)).begin(),matrix_->begin(),std::divides<T>());
5849 template<
typename T>
5853 assert(matrix_->size() != 0);
5854 return *std::min_element(matrix_->begin(),matrix_->end());
5857 template<
typename T>
5861 assert(matrix_->size() != 0);
5862 return *std::max_element(matrix_->begin(),matrix_->end());
5865 template<
typename T>
5869 assert(matrix_->size() != 0);
5870 return std::accumulate(matrix_->begin(),matrix_->end(),T());
5874 template<
typename T>
5878 slip::apply(this->begin(),this->end(),this->begin(),fun);
5882 template<
typename T>
5886 slip::apply(this->begin(),this->end(),this->begin(),fun);
5893 template<
typename T>
5903 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::plus<T>());
5907 template<
typename T>
5917 template<
typename T>
5926 template<
typename T>
5936 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::minus<T>());
5940 template<
typename T>
5950 template<
typename T>
5958 template<
typename T>
5968 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::multiplies<T>());
5972 template<
typename T>
5982 template<
typename T>
5990 template<
typename T>
6000 std::transform(M1.
begin(),M1.
end(),M2.
begin(),tmp.begin(),std::divides<T>());
6004 template<
typename T>
6015 template<
typename T>
6022 template<
typename T>
6029 template<
typename T>
6039 template<
typename T>
6048 template<
typename T>
6057 template<
typename T>
6066 template<
typename T>
6075 template<
typename T>
6084 template<
typename T>
6093 template<
typename T>
6102 template<
typename T>
6111 template<
typename T>
6120 template<
typename T>
6129 template<
typename T>
6138 template<
typename T>
6147 template<
typename T>
6160 #endif //SLIP_VOLUME_HPP
reverse_iterator3d rfront_upper_left()
Returns a read/write reverse iterator3d. It points to the back bottom right element of the Volume...
Volume(const size_type d1, const size_type d2, const size_type d3, InputIterator first, InputIterator last)
Contructs a Volume from a range.
HyperVolume< T > tanh(const HyperVolume< T > &M)
size_type dim1() const
Returns the number of slices (first dimension size) in the Volume.
bool operator!=(const Array< T > &x, const Array< T > &y)
reverse_iterator plane_rbegin(const size_type slice)
Returns a read/write reverse iterator that points to the last element in the slice plane of the Volum...
ptrdiff_t difference_type
slip::Array3d< T >::const_iterator3d const_iterator3d
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
std::reverse_iterator< const_iterator > const_reverse_iterator
std::reverse_iterator< slice_iterator > reverse_slice_iterator
col_iterator col_end(const size_type slice, const size_type col)
Returns a read/write iterator that points to the past-the-end element of the column column of the sli...
slip::stride_iterator< col_iterator > col_range_iterator
Volume< T > sqrt(const Volume< T > &M)
iterator3d back_bottom_right()
Returns a read/write iterator3d that points to the past the end element of the Volume. It points to past the end element of the back bottom right element of the Volume.
slip::stride_iterator< pointer > row_range_iterator
reverse_slice_iterator slice_rend(const size_type row, const size_type col)
Returns a read/write iterator that points to the one before the first element of the line (row...
iterator3d default_iterator
Volume< T > tanh(const Volume< T > &M)
reverse_slice_iterator slice_rbegin(const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (row,col) threw the slices ...
slip::Array3d< T >::iterator3d iterator3d
reference operator()(const size_type k, const size_type i, const size_type j)
Subscript access to the data contained in the Volume.
void write_tecplot_vol(const Container3d &container, const std::string &file_path_name, const std::string &title)
Write a Container3D to a tecplot file.
void fill(const T &value)
Fills the container range [begin(),begin()+size()) with copies of value.
reverse_iterator2d plane_rupper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the bottom right element of the plane in the Vol...
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
Volume< T > atan(const Volume< T > &M)
HyperVolume< T > cosh(const HyperVolume< T > &M)
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
std::reverse_iterator< col_range_iterator > reverse_col_range_iterator
iterator plane_begin(const size_type slice)
Returns a read/write iterator that points to the first element in the in the slice plane of the Volum...
std::reverse_iterator< iterator3d_range > reverse_iterator3d_range
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
Volume< T > sinh(const Volume< T > &M)
Volume< T > log10(const Volume< T > &M)
reverse_iterator plane_rend(const size_type slice)
Returns a read/write reverse iterator that points to one before the first element in the slice plane ...
slip::Volume< long > Volume_l
long alias
iterator3d front_upper_left()
Returns a read/write iterator3d that points to the first element of the Volume. It points to the fron...
slip::stride_iterator< const_pointer > const_col_iterator
HyperVolume< T > atan(const HyperVolume< T > &M)
reverse_row_iterator row_rend(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the first element of the row row of the slice sl...
slip::Volume< int > Volume_i
int alias
void resize(std::size_t d1, std::size_t d2, std::size_t d3, const T &val=T())
Resizes a Volume.
slice_iterator slice_end(const size_type row, const size_type col)
Returns a read/write iterator that points to the one past the end element of the line (row...
slip::Volume< unsigned int > Volume_ui
unsigned int alias
void write_tecplot(const std::string &file_path_name, const std::string &title) const
Write a Volume to a tecplot file.
std::reverse_iterator< const_iterator > const_reverse_row_iterator
std::reverse_iterator< iterator > reverse_iterator
void swap(Volume &M)
Swaps data with another Volume.
static const std::size_t DIM
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Matrix3d. Iteration is done in ordinary element order.
slip::Volume< unsigned char > Volume_uc
unsigned char alias
slip::Volume< unsigned long > Volume_ul
unsigned long alias
HyperVolume< T > exp(const HyperVolume< T > &M)
col_iterator col_begin(const size_type slice, const size_type col)
Returns a read/write iterator that points to the first element of the column column of the slice slic...
Volume< T > tan(const Volume< T > &M)
Numerical volume class This is a two-dimensional dynamic and generic container. This container statis...
row_iterator row_begin(const size_type slice, const size_type row)
Returns a read/write iterator that points to the first element of the row row of the slice slice in t...
std::reverse_iterator< iterator2d > reverse_iterator2d
~Volume()
Destructor of the Volume.
slip::Volume< char > Volume_c
char alias
void fill(const T *value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
Volume< T > cos(const Volume< T > &M)
slip::Volume< double > Volume_d
double alias
PLANE_ORIENTATION
Choose between different plane orientations.
size_type slices() const
Returns the number of slices (first dimension size) in the Volume.
HyperVolume< T > abs(const HyperVolume< T > &M)
bool operator>(const Array< T > &x, const Array< T > &y)
slip::Array3d< T >::const_iterator3d_range const_iterator3d_range
Provides a class to manipulate iterator3d within a slip::Range. It is used to iterate throw 3d contai...
HyperVolume< T > sin(const HyperVolume< T > &M)
T & max() const
Returns the max element of the Volume according to the operator <.
HyperVolume< T > cos(const HyperVolume< T > &M)
Volume< T > acos(const Volume< T > &M)
slip::Volume< short > Volume_s
short alias
Volume< T > exp(const Volume< T > &M)
slip::stride_iterator< pointer > col_iterator
iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the last element of the plane in the Volume...
const_pointer const_iterator
slip::stride_iterator< const_pointer > const_slice_iterator
slip::Array3d< T >::const_iterator2d const_iterator2d
slip::Array3d< T >::iterator3d_range iterator3d_range
size_type dim2() const
Returns the number of rows (second dimension size) in the Volume.
slip::Array3d< T >::iterator2d iterator2d
reverse_col_iterator col_rend(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the first element of the column column of the sl...
void write_to_images_tecplot(Container3d &container, const std::string &file_path_name, const std::string &title, const std::size_t from, const std::size_t to)
Write slices of a Container3D to a tecplot file.
reverse_col_iterator col_rbegin(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the last element of the column column of the sli...
std::reverse_iterator< const_iterator2d > const_reverse_iterator2d
size_type max_size() const
Returns the maximal size (number of elements) in the Volume.
Volume()
Constructs a Volume.
Numerical matrix3d class. This container statisfies the RandomAccessContainer concepts of the STL exc...
size_type columns() const
Returns the number of columns (third dimension size) in the Volume.
reverse_iterator3d rfront_upper_left()
Returns a read/write reverse iterator3d. It points to the back bottom right element of the Matrix3d...
const_iterator3d const_default_iterator
reverse_row_iterator row_rbegin(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the last element of the row row of the slice sli...
std::reverse_iterator< const_iterator3d > const_reverse_iterator3d
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
reverse_iterator3d rback_bottom_right()
Returns a read/write reverse iterator3d. It points to past the front upper left element of the Volume...
Provides a class to manipulate iterator2d within a slip::Box3d. It is used to iterate throw 3d contai...
Volume< T > & apply(T(*fun)(T))
Applys the one-parameter C-function fun to each element of the Volume.
std::reverse_iterator< const_slice_range_iterator > const_reverse_slice_range_iterator
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
std::reverse_iterator< const_row_range_iterator > const_reverse_row_range_iterator
iterator plane_end(const size_type slice)
Returns a read/write iterator that points one past the last element in the slice plane of the Volume...
T & min() const
Returns the min element of the Volume according to the operator <.
HyperVolume< T > sqrt(const HyperVolume< T > &M)
size_type cols() const
Returns the number of columns (third dimension size) in the Volume.
reverse_iterator3d rback_bottom_right()
Returns a read/write reverse iterator3d. It points to past the front upper left element of the Matrix...
HyperVolume< T > sinh(const HyperVolume< T > &M)
std::reverse_iterator< row_range_iterator > reverse_row_range_iterator
Volume< T > cosh(const Volume< T > &M)
size_type slice_size() const
Returns the number of elements in a slice of the Volume.
Provides a class to iterate 3d containers throw a planes.
size_type rows() const
Returns the number of rows (second dimension size) in the Volume.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Volume. Iteration is done in ordinary element order.
Volume< T > asin(const Volume< T > &M)
Provides a class to manipulate Matrix3d.
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
row_iterator row_end(const size_type slice, const size_type row)
Returns a read/write iterator that points to the past-the-end element of the row row of the slice sli...
self & operator-=(const T &val)
T sum() const
Returns the sum of the elements of the Volume.
slip::stride_iterator< const_pointer > const_row_range_iterator
HyperVolume< T > log(const HyperVolume< T > &M)
slip::Volume< float > Volume_f
float alias
slice_iterator slice_begin(const size_type row, const size_type col)
Returns a read/write iterator that points to the first element of the line (row,col) threw the slices...
slip::stride_iterator< pointer > slice_iterator
Volume< T > sin(const Volume< T > &M)
void write_raw(const std::string &file_path_name) const
Write a Volume to a file path name.
size_type size() const
Returns the number of elements in the Volume.
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
T ** operator[](const size_type k)
HyperVolume< T > acos(const HyperVolume< T > &M)
void read_raw(const std::string &file_path_name, const std::size_t slices, const std::size_t rows, const std::size_t cols)
Reads a Volume from a file path name.
self & operator=(const Volume< T > &rhs)
Assign a Volume.
slip::stride_iterator< const_col_iterator > const_col_range_iterator
HyperVolume< T > log10(const HyperVolume< T > &M)
slip::stride_iterator< slice_iterator > slice_range_iterator
std::reverse_iterator< iterator3d > reverse_iterator3d
self & operator*=(const T &val)
self & operator/=(const T &val)
const value_type & const_reference
void write_to_images_tecplot(const std::string &file_path_name, const std::string &title, const std::size_t from, const std::size_t to) const
Write slices of a Container3D to a tecplot file.
std::reverse_iterator< const_slice_iterator > const_reverse_slice_iterator
std::reverse_iterator< const_col_range_iterator > const_reverse_col_range_iterator
self & operator+=(const T &val)
Add val to each element of the Volume.
std::reverse_iterator< col_iterator > reverse_col_iterator
const_pointer const_row_iterator
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
Provides some algorithms to apply C like functions to ranges.
Provides a class to iterate a 1d range according to a step.
HyperVolume< T > tan(const HyperVolume< T > &M)
Volume< T > log(const Volume< T > &M)
slip::Volume< unsigned short > Volume_us
unsigned long alias
bool operator==(const Array< T > &x, const Array< T > &y)
HyperVolume< T > asin(const HyperVolume< T > &M)
void write_raw(InputIterator first, InputIterator last, const std::string &file_path_name)
Write a Container to an raw file.
Volume< T > abs(const Volume< T > &M)
iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the first element of the plane in the Volume...
reverse_iterator2d plane_rbottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the upper left element of the plane in the Volum...
std::reverse_iterator< iterator > reverse_row_iterator
std::string name() const
Returns the name of the class.
size_type dim3() const
Returns the number of columns (third dimension size) in the Volume.
std::reverse_iterator< slice_range_iterator > reverse_slice_range_iterator
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
std::reverse_iterator< const_iterator3d_range > const_reverse_iterator3d_range
iterator end()
Returns a read/write iterator that points one past the last element in the Matrix3d. Iteration is done in ordinary element order.
bool empty() const
Returns true if the Volume is empty. (Thus size() == 0)
iterator end()
Returns a read/write iterator that points one past the last element in the Volume. Iteration is done in ordinary element order.
void apply(InputIterator first, InputIterator last, OutputIterator result, typename std::iterator_traits< OutputIterator >::value_type(*function)(typename std::iterator_traits< InputIterator >::value_type))
Applies a C-function to each element of a range.
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
iterator3d front_upper_left()
Returns a read/write iterator3d that points to the first element of the Matrix3d. It points to the fr...
iterator3d back_bottom_right()
Returns a read/write iterator3d that points to the past the end element of the Matrix3d. It points to past the end element of the back bottom right element of the Matrix3d.
bool operator>=(const Array< T > &x, const Array< T > &y)
const value_type * const_pointer
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the Volume. Iteration is done in reverse element order.
friend class boost::serialization::access
slip::stride_iterator< const_slice_iterator > const_slice_range_iterator
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the Volume...
void read_raw(const std::string &file_path_name, InputIterator first, InputIterator last)
Write a Container to an raw file.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...