7 #ifndef IMPEM2D_IMAGE_H
8 #define IMPEM2D_IMAGE_H
10 #include <IMP/em2d/em2d_config.h>
24 IMPEM2D_BEGIN_NAMESPACE
36 Image(
int rows,
int cols);
44 read(filename, reader);
69 void set_value(
double val) { data_.setConstant(val); }
77 void set_value(
int i,
int j,
double val) { data_(i, j) = val; }
85 double operator()(
int i,
int j)
const {
return data_(i, j); }
101 void set_size(
int rows,
int cols);
107 void set_size(
Image *img);
115 void update_header();
125 reader->read(filename, header_, data_);
138 writer->write(filename, header_, data_);
145 void show(std::ostream &out)
const {
146 out <<
"Image name : " << name_;
174 void set_size_data(
int rows,
int cols);
243 IMPEM2DEXPORT
void do_normalize(Image *im,
bool force =
false);
276 double pixelsize,
int time_steps) {
278 pixelsize, time_steps);
281 inline void do_fill_holes(Image *input, Image *result,
double n_stddevs) {
282 do_fill_holes(input->get_data(), result->get_data(), n_stddevs);
285 inline void do_combined_fill_holes_and_threshold(Image *input, Image *result,
287 do_combined_fill_holes_and_threshold(input->get_data(), result->get_data(),
291 inline void do_extend_borders(Image *im1, Image *im2,
unsigned int pix) {
292 do_extend_borders(im1->get_data(), im2->get_data(), pix);
295 inline void do_segmentation(Image *input, Image *result,
296 const SegmentationParameters ¶ms) {
297 do_segmentation(input->get_data(), result->get_data(), params);
300 IMPEM2DEXPORT
void do_remove_small_objects(Image *input,
double percentage,
313 IMPEM2DEXPORT
void add_noise(Image *im1,
double op1,
double op2,
314 const String &mode =
"uniform",
double df = 3);
323 Image *im1, Image *im2,
const PolarResamplingParameters &polar_params);
330 IMPEM2DEXPORT
void crop(Image *img,
const IntPair ¢er,
int size);
340 IMPEM2D_END_NAMESPACE
Image processing functions.
void set_name(const String &name)
void set_value(double val)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
void apply_variance_filter(Image *input, Image *filtered, int kernelsize)
void apply_diffusion_filter(Image *input, Image *filtered, double beta, double pixelsize, int time_steps)
Virtual class for reader/writers of images.
em::ImageHeader header_
Header for the image with all the pertinent information.
Virtual class for reader/writers of images Copyright 2007-2026 IMP Inventors. All rights reserved...
std::pair< Float, Float > FloatRange
A pair representing the allowed range for a Float attribute.
void apply_mean_outside_mask(Image *img, double radius)
void set_value(int i, int j, double val)
em::ImageHeader & get_header()
DoubleMatrix & get_data()
Floats get_histogram(Image *img, int bins)
void do_subtract_images(Image *first, Image *second, Image *result)
A smart pointer to a reference counted object.
String name_
Name of the image. Frequently it will be the name of the file.
void read(String filename, const ImageReaderWriter *reader)
Image(String filename, const ImageReaderWriter *reader)
Common base class for heavy weight IMP objects.
void get_correlation2d(Image *im1, Image *im2, Image *corr)
Images read_images(const Strings &names, const ImageReaderWriter *rw)
Matrices used to store image data Copyright 2007-2026 IMP Inventors. All rights reserved.
Functions related with rotations in em2d Copyright 2007-2026 IMP Inventors. All rights reserved...
void crop(Image *img, const IntPair ¢er, int size)
double operator()(int i, int j) const
double get_cross_correlation_coefficient(Image *im1, Image *im2)
Cross correlation between two images.
void save_images(Images images, const Strings &names, const ImageReaderWriter *rw)
void write(const String &filename, const ImageReaderWriter *writer)
void do_normalize(Image *im, bool force=false)
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
void do_resample_polar(Image *im1, Image *im2, const PolarResamplingParameters &polar_params)
A nullptr-initialized pointer to an IMP Object.
A shared base class to help in debugging and things.
void get_autocorrelation2d(Image *im1, Image *im2)
DoubleMatrix data_
Matrix with the data for the image.
void show(std::ostream &out) const
Eigen::Array< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DoubleMatrix
Matrix of doubles, used to store the data of an image.
Operations involving FFT Copyright 2007-2026 IMP Inventors. All rights reserved.
std::string String
Basic string value.
2D Electron Microscopy images in IMP
void set_was_used(bool tf) const