bioformats  5.1.3
FormatReader.h
1 /*
2  * #%L
3  * OME-BIOFORMATS C++ library for image IO.
4  * Copyright © 2006 - 2015 Open Microscopy Environment:
5  * - Massachusetts Institute of Technology
6  * - National Institutes of Health
7  * - University of Dundee
8  * - Board of Regents of the University of Wisconsin-Madison
9  * - Glencoe Software, Inc.
10  * %%
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing official
34  * policies, either expressed or implied, of any organization.
35  * #L%
36  */
37 
38 #ifndef OME_BIOFORMATS_DETAIL_FORMATREADER_H
39 #define OME_BIOFORMATS_DETAIL_FORMATREADER_H
40 
41 #include <string>
42 #include <vector>
43 #include <map>
44 
45 #include <boost/lexical_cast.hpp>
46 
47 #include <ome/bioformats/FormatReader.h>
48 #include <ome/bioformats/FormatHandler.h>
49 
50 namespace ome
51 {
52  namespace bioformats
53  {
60  namespace detail
61  {
62 
67  {
69  std::string name;
71  std::string description;
73  std::vector<boost::filesystem::path> suffixes;
75  std::vector<boost::filesystem::path> compression_suffixes;
77  std::set<MetadataOptions::MetadataLevel> metadata_levels;
78 
85  ReaderProperties(const std::string& name,
86  const std::string& description):
87  name(name),
88  description(description),
89  suffixes(),
90  compression_suffixes(),
91  metadata_levels()
92  {
93  compression_suffixes.push_back(boost::filesystem::path(""));
94  }
95  };
96 
110  virtual public ::ome::bioformats::FormatHandler
111  {
112  protected:
114  typedef std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> > coremetadata_list_type;
115 
118 
120  boost::optional<boost::filesystem::path> currentId;
121 
123  ome::compat::shared_ptr<std::istream> in;
124 
127 
135 
143 
151 
153  coremetadata_list_type core;
154 
162 
165 
172 
178 
181 
183  std::string datasetDescription;
184 
187 
190 
193 
196 
198  bool group;
199 
201  std::vector<std::string> domains;
202 
207  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore> metadataStore;
208 
211 
214 
215  public:
217  virtual
218  ~FormatReader();
219 
220  private:
222  FormatReader (const FormatReader&);
223 
225  FormatReader&
226  operator= (const FormatReader&);
227 
228  protected:
243  virtual
244  void
245  initFile(const boost::filesystem::path& id);
246 
253  virtual
254  bool
255  isUsedFile(const boost::filesystem::path& file);
256 
271  virtual
272  void
273  readPlane(std::istream& source,
274  VariantPixelBuffer& dest,
279  dimension_size_type samples);
280 
296  virtual
297  void
298  readPlane(std::istream& source,
299  VariantPixelBuffer& dest,
304  dimension_size_type scanlinePad,
305  dimension_size_type samples);
306 
315  virtual
316  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>
318 
327  const CoreMetadata&
329  {
330  coremetadata_list_type::value_type cm(core.at(index));
331  if (!cm)
332  throw std::logic_error("CoreMetadata null");
333  return *cm;
334  }
335 
344  CoreMetadata&
346  {
347  coremetadata_list_type::value_type cm(core.at(index));
348  if (!cm)
349  throw std::logic_error("CoreMetadata null");
350  return *cm;
351  }
352 
353  public:
354  // Documented in superclass.
355  const std::set<MetadataOptions::MetadataLevel>&
357 
358  // Documented in superclass.
359  void
360  setMetadataOptions(const MetadataOptions& options);
361 
362  // Documented in superclass.
363  const MetadataOptions&
364  getMetadataOptions() const;
365 
368 
369  // Documented in superclass.
370  const MetadataMap&
371  getGlobalMetadata() const;
372 
373  // Documented in superclass.
375  getMetadataValue(const std::string& field) const;
376 
377  // Documented in superclass.
378  const MetadataMap&
379  getSeriesMetadata() const;
380 
381  // Documented in superclass.
383  getSeriesMetadataValue(const MetadataMap::key_type& field) const;
384 
385  // Documented in superclass.
386  bool
387  isThisType(const boost::filesystem::path& name,
388  bool open = true) const;
389 
390  // Documented in superclass.
391  bool
392  isThisType(const uint8_t *begin,
393  std::size_t length) const;
394 
395  // Documented in superclass.
396  bool
397  isThisType(const uint8_t *begin,
398  const uint8_t *end) const;
399 
400  // Documented in superclass.
401  bool
402  isThisType(std::istream& stream) const;
403 
404  protected:
417  virtual
418  bool
419  isFilenameThisTypeImpl(const boost::filesystem::path& name) const;
420 
433  virtual
434  bool
435  isStreamThisTypeImpl(std::istream& stream) const;
436 
437  public:
438  // Documented in superclass.
440  getImageCount() const;
441 
442  // Documented in superclass.
443  bool
444  isRGB(dimension_size_type channel) const;
445 
446  // Documented in superclass.
448  getSizeX() const;
449 
450  // Documented in superclass.
452  getSizeY() const;
453 
454  // Documented in superclass.
456  getSizeZ() const;
457 
458  // Documented in superclass.
460  getSizeT() const;
461 
462  // Documented in superclass.
464  getSizeC() const;
465 
466  // Documented in superclass.
468  getPixelType() const;
469 
470  // Documented in superclass.
472  getBitsPerPixel() const;
473 
474  // Documented in superclass.
476  getEffectiveSizeC() const;
477 
478  // Documented in superclass.
481 
482  // Documented in superclass.
483  bool
484  isIndexed() const;
485 
486  // Documented in superclass.
487  bool
488  isFalseColor() const;
489 
490  // Documented in superclass.
491  void
493  VariantPixelBuffer& buf) const;
494 
495  // Documented in superclass.
496  Modulo&
497  getModuloZ();
498 
499  // Documented in superclass.
500  const Modulo&
501  getModuloZ() const;
502 
503  // Documented in superclass.
504  Modulo&
505  getModuloT();
506 
507  // Documented in superclass.
508  const Modulo&
509  getModuloT() const;
510 
511  // Documented in superclass.
512  Modulo&
513  getModuloC();
514 
515  // Documented in superclass.
516  const Modulo&
517  getModuloC() const;
518 
519  protected:
526  ome::compat::array<dimension_size_type, 2>
527  getThumbSize() const;
528 
529  public:
530  // Documented in superclass.
532  getThumbSizeX() const;
533 
534  // Documented in superclass.
536  getThumbSizeY() const;
537 
538  // Documented in superclass.
539  bool
540  isLittleEndian() const;
541 
542  // Documented in superclass.
543  const std::string&
544  getDimensionOrder() const;
545 
546  // Documented in superclass.
547  bool
548  isOrderCertain() const;
549 
550  // Documented in superclass.
551  bool
552  isThumbnailSeries() const;
553 
554  // Documented in superclass.
555  bool
556  isInterleaved() const;
557 
558  // Documented in superclass.
559  bool
561 
562  // Documented in superclass.
563  void
565  VariantPixelBuffer& buf) const;
566 
567  // Documented in superclass.
568  void
570  VariantPixelBuffer& buf,
574  dimension_size_type h) const;
575 
576  protected:
580  virtual
581  void
583  VariantPixelBuffer& buf,
587  dimension_size_type h) const = 0;
588 
589  public:
590  // Documented in superclass.
591  void
593  VariantPixelBuffer& buf) const;
594 
595  // Documented in superclass.
596  void
597  close(bool fileOnly = false);
598 
599  // Documented in superclass.
601  getSeriesCount() const;
602 
603  // Documented in superclass.
604  void
605  setSeries(dimension_size_type series) const;
606 
607  // Documented in superclass.
609  getSeries() const;
610 
611  // Documented in superclass.
612  void
613  setPlane(dimension_size_type plane) const;
614 
615  // Documented in superclass.
617  getPlane() const;
618 
619  // Documented in superclass.
620  void
621  setGroupFiles(bool group);
622 
623  // Documented in superclass.
624  bool
625  isGroupFiles() const;
626 
627  // Documented in superclass.
629  fileGroupOption(const std::string& id);
630 
631  // Documented in superclass.
632  bool
633  isMetadataComplete() const;
634 
635  // Documented in superclass.
636  void
637  setNormalized(bool normalize);
638 
639  // Documented in superclass.
640  bool
641  isNormalized() const;
642 
643  // Documented in superclass.
644  void
645  setOriginalMetadataPopulated(bool populate);
646 
647  // Documented in superclass.
648  bool
650 
651  // Documented in superclass.
652  const std::vector<boost::filesystem::path>
653  getUsedFiles(bool noPixels = false) const;
654 
655  // Documented in superclass.
656  const std::vector<boost::filesystem::path>
657  getSeriesUsedFiles(bool noPixels = false) const;
658 
659  // Documented in superclass.
660  std::vector<FileInfo>
661  getAdvancedUsedFiles(bool noPixels = false) const;
662 
663  // Documented in superclass.
664  std::vector<FileInfo>
665  getAdvancedSeriesUsedFiles(bool noPixels = false) const;
666 
667  // Documented in superclass.
668  const boost::optional<boost::filesystem::path>&
669  getCurrentFile() const;
670 
671  // Documented in superclass.
675  dimension_size_type t) const;
676 
677  // Documented in superclass.
682  dimension_size_type moduloZ,
683  dimension_size_type moduloC,
684  dimension_size_type moduloT) const;
685 
686  // Documented in superclass.
687  ome::compat::array<dimension_size_type, 3>
688  getZCTCoords(dimension_size_type index) const;
689 
690  // Documented in superclass.
691  ome::compat::array<dimension_size_type, 6>
693 
694  // Documented in superclass.
695  const std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> >&
696  getCoreMetadataList() const;
697 
698  // Documented in superclass.
699  void
700  setMetadataFiltered(bool filter);
701 
702  // Documented in superclass.
703  bool
704  isMetadataFiltered() const;
705 
706  // Documented in superclass.
707  void
708  setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>& store);
709 
710  // Documented in superclass.
711  const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
712  getMetadataStore() const;
713 
714  // Documented in superclass.
715  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
717 
718  // Documented in superclass.
719  std::vector<ome::compat::shared_ptr< ::ome::bioformats::FormatReader> >
720  getUnderlyingReaders() const;
721 
722  // Documented in superclass.
723  bool
724  isSingleFile(const boost::filesystem::path& id) const;
725 
726  // Documented in superclass.
727  uint32_t
728  getRequiredDirectories(const std::vector<std::string>& files) const;
729 
730  // Documented in superclass.
731  const std::string&
733 
734  // Documented in superclass.
735  const std::vector<std::string>&
736  getPossibleDomains(const std::string& id) const;
737 
738  // Documented in superclass.
739  bool
740  hasCompanionFiles() const;
741 
742  // Documented in superclass.
743  const std::vector<std::string>&
744  getDomains() const;
745 
746  // Documented in superclass.
749 
750  // Documented in superclass.
753 
754  // Documented in superclass.
756  getOptimalTileWidth() const;
757 
758  // Documented in superclass.
760  getOptimalTileHeight() const;
761 
762  // Documented in superclass.
765 
766  // Documented in superclass.
769 
770  // Documented in superclass.
772  getCoreIndex() const;
773 
774  // Documented in superclass.
775  void
776  setCoreIndex(dimension_size_type index) const;
777 
778  // Documented in superclass.
780  getResolutionCount() const;
781 
782  // Documented in superclass.
783  void
784  setResolution(dimension_size_type resolution) const;
785 
786  // Documented in superclass.
788  getResolution() const;
789 
790  // Documented in superclass.
791  bool
792  hasFlattenedResolutions() const;
793 
794  // Documented in superclass.
795  void
796  setFlattenedResolutions(bool flatten);
797 
798  // Documented in superclass.
799  void
800  setId(const boost::filesystem::path& id);
801 
802  // Documented in superclass.
803  const std::string&
804  getFormat() const;
805 
806  // Documented in superclass.
807  const std::string&
808  getFormatDescription() const;
809 
810  // Documented in superclass.
811  const std::vector<boost::filesystem::path>&
812  getSuffixes() const;
813 
814  // Documented in superclass.
815  const std::vector<boost::filesystem::path>&
816  getCompressionSuffixes() const;
817  };
818 
819  }
820  }
821 }
822 
823 #endif // OME_BIOFORMATS_DETAIL_FORMATREADER_H
824 
825 /*
826  * Local Variables:
827  * mode:C++
828  * End:
829  */
bool isLittleEndian() const
Get whether the data is in little-endian format.
Definition: FormatReader.cpp:688
bool isMetadataComplete() const
Get status of metadata parsing.
Definition: FormatReader.cpp:841
Interface for all biological file format readers (default behaviour).
Definition: FormatReader.h:109
ome::xml::model::enums::PixelType getPixelType() const
Get the pixel type.
Definition: FormatReader.cpp:537
virtual void openBytesImpl(dimension_size_type plane, VariantPixelBuffer &buf, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) const =0
Obtain a sub-image of an image plane.
const std::vector< boost::filesystem::path > & getSuffixes() const
Get the default file suffixes for this file format.
Definition: FormatReader.cpp:124
Modulo & getModuloC()
Get the Modulo subdivision of the C dimension.
Definition: FormatReader.cpp:620
bool isSingleFile(const boost::filesystem::path &id) const
Is this a single-file format?
Definition: FormatReader.cpp:1103
void openThumbBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain a thumbnail of an image plane.
Definition: FormatReader.cpp:748
const std::vector< boost::filesystem::path > getSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:893
const std::string & getFormatDescription() const
Get the description of this file format.
Definition: FormatReader.cpp:118
bool isThumbnailSeries() const
Get whether the current series is a lower resolution copy of a different series.
Definition: FormatReader.cpp:709
A subdimension of Z, C, or T.
Definition: Modulo.h:57
std::string description
Format description.
Definition: FormatReader.h:71
FileGroupOption fileGroupOption(const std::string &id)
Returns an enum indicating that we cannot, must, or might group the files in this dataset...
Definition: FormatReader.cpp:835
Metadata key-value map using a restricted set of value types.
Definition: MetadataMap.h:79
dimension_size_type getSizeY() const
Get the size of the Y dimension.
Definition: FormatReader.cpp:506
const boost::optional< boost::filesystem::path > & getCurrentFile() const
Get the currently open file.
Definition: FormatReader.cpp:960
uint32_t pixel_size_type
Size type for pixel bit depths.
Definition: Types.h:62
Interface for all biological file format readers and writers.
Definition: FormatHandler.h:64
Properties specific to a particular reader.
Definition: FormatReader.h:66
ome::compat::array< dimension_size_type, 2 > getThumbSize() const
Get the thumbnail size of the X and Y dimensions.
Definition: FormatReader.cpp:632
void setCoreIndex(dimension_size_type index) const
Set the current resolution/series (ignoring sub-resolutions).
Definition: FormatReader.cpp:1344
const CoreMetadata & getCoreMetadata(dimension_size_type index) const
Get CoreMetadata by core index.
Definition: FormatReader.h:328
dimension_size_type seriesToCoreIndex(dimension_size_type series) const
Get the first core index corresponding to the specified series.
Definition: FormatReader.cpp:1185
dimension_size_type getResolution() const
Get the active resolution level.
Definition: FormatReader.cpp:1319
MetadataOptions metadataOptions
Metadata parsing options.
Definition: FormatReader.h:210
bool isThisType(const boost::filesystem::path &name, bool open=true) const
Check if the given file is a valid instance of this file format.
Definition: FormatReader.cpp:420
std::vector< FileInfo > getAdvancedSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:931
Interface for all biological file format readers.
Definition: FormatReader.h:70
void setPlane(dimension_size_type plane) const
Set the active plane.
Definition: FormatReader.cpp:799
void getLookupTable(dimension_size_type plane, VariantPixelBuffer &buf) const
Get the color lookup table associated with an image plane.
Definition: FormatReader.cpp:587
ome::compat::array< dimension_size_type, 6 > getZCTModuloCoords(dimension_size_type index) const
Get the Z, C, T, ModuloZ, ModuloC and ModuloT coordinate of a linear index.
Definition: FormatReader.cpp:1013
bool companionFiles
Whether this format supports multi-file datasets.
Definition: FormatReader.h:180
void openBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain an image plane.
Definition: FormatReader.cpp:729
ome::compat::array< dimension_size_type, 3 > getZCTCoords(dimension_size_type index) const
Get the Z, C and T coordinate of a linear index.
Definition: FormatReader.cpp:1001
std::vector< std::string > domains
List of domains in which this format is used.
Definition: FormatReader.h:201
bool isRGB(dimension_size_type channel) const
Check if the image planes for a channel have more than one sub-channel per openBytes() call...
Definition: FormatReader.cpp:492
void setGroupFiles(bool group)
Set file grouping.
Definition: FormatReader.cpp:822
dimension_size_type getPlane() const
Get the active plane.
Definition: FormatReader.cpp:814
void setMetadataFiltered(bool filter)
Set metadata filtering.
Definition: FormatReader.cpp:1061
ReaderProperties(const std::string &name, const std::string &description)
Constructor.
Definition: FormatReader.h:85
void setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > &store)
Set the default metadata store for this reader.
Definition: FormatReader.cpp:1074
pixel_size_type getBitsPerPixel() const
Get the number of valid bits per pixel.
Definition: FormatReader.cpp:544
std::vector< ome::compat::shared_ptr< ::ome::bioformats::FormatReader > > getUnderlyingReaders() const
Get all underlying readers.
Definition: FormatReader.cpp:1097
void setId(const boost::filesystem::path &id)
Set the current file name.
Definition: FormatReader.cpp:1359
::ome::bioformats::MetadataMap metadata
Mapping of metadata key/value pairs.
Definition: FormatReader.h:126
const std::vector< boost::filesystem::path > getUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:874
virtual void readPlane(std::istream &source, VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h, dimension_size_type samples)
Read a raw plane.
Definition: FormatReader.cpp:206
void setNormalized(bool normalize)
Set float normalization.
Definition: FormatReader.cpp:848
FormatReader()
Constructor.
Definition: FormatReader.h:141
dimension_size_type getSeriesCount() const
Get the number of image series in this file.
Definition: FormatReader.cpp:773
virtual bool isFilenameThisTypeImpl(const boost::filesystem::path &name) const
isThisType file implementation for readers.
Definition: FormatReader.cpp:473
Metadata options.
Definition: MetadataOptions.h:55
void setFlattenedResolutions(bool flatten)
Set resolution flattening.
Definition: FormatReader.cpp:1331
void setOriginalMetadataPopulated(bool populate)
Specifies whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.cpp:861
virtual bool isStreamThisTypeImpl(std::istream &stream) const
isThisType stream implementation for readers.
Definition: FormatReader.cpp:479
std::vector< boost::filesystem::path > suffixes
Filename suffixes this format can handle.
Definition: FormatReader.h:73
void close(bool fileOnly=false)
Close the currently open file.
Definition: FormatReader.cpp:760
dimension_size_type getSizeC() const
Get the size of the C dimension.
Definition: FormatReader.cpp:527
boost::make_variant_over< discriminated_types >::type value_type
Value type, allowing assignment of all storable types.
Definition: MetadataMap.h:150
Core metadata values.
Definition: CoreMetadata.h:78
bool isInterleaved() const
Get whether or not the channels are interleaved.
Definition: FormatReader.cpp:716
const ReaderProperties & readerProperties
Reader properties specific to the derived file format.
Definition: FormatReader.h:117
bool flattenedResolutions
Whether or not resolutions are flattened.
Definition: FormatReader.h:164
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
const std::vector< ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata > > & getCoreMetadataList() const
Get the core metadata.
Definition: FormatReader.cpp:1054
bool isNormalized() const
Get float normalization.
Definition: FormatReader.cpp:855
std::string key_type
Key type.
Definition: MetadataMap.h:147
CoreMetadata & getCoreMetadata(dimension_size_type index)
Get CoreMetadata by core index.
Definition: FormatReader.h:345
dimension_size_type plane
The number of the current plane in the current series.
Definition: FormatReader.h:150
std::string name
Format name.
Definition: FormatReader.h:69
dimension_size_type coreIndexToSeries(dimension_size_type index) const
Get the series corresponding to the specified core index.
Definition: FormatReader.cpp:1243
coremetadata_list_type core
Core metadata values.
Definition: FormatReader.h:153
const MetadataMap::value_type & getMetadataValue(const std::string &field) const
Get a global metadata value.
Definition: FormatReader.cpp:1028
bool isOrderCertain() const
Get whether the dimension order and sizes are known, or merely guesses.
Definition: FormatReader.cpp:702
const MetadataMap::value_type & getSeriesMetadataValue(const MetadataMap::key_type &field) const
Get a series metadata value.
Definition: FormatReader.cpp:1034
const std::string & getDimensionOrder() const
Get the dimension order.
Definition: FormatReader.cpp:695
dimension_size_type getEffectiveSizeC() const
Get the effective size of the C dimension.
Definition: FormatReader.cpp:561
dimension_size_type getCoreIndex() const
Get the CoreMetadata index of the current resolution/series.
Definition: FormatReader.cpp:1338
std::vector< FileInfo > getAdvancedUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:902
bool filterMetadata
Whether or not to filter out invalid metadata.
Definition: FormatReader.h:189
std::string datasetDescription
Short description of the structure of the dataset.
Definition: FormatReader.h:183
dimension_size_type getImageCount() const
Determine the number of image planes in the current series.
Definition: FormatReader.cpp:485
std::vector< ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata > > coremetadata_list_type
List type for storing CoreMetadata.
Definition: FormatReader.h:114
bool normalizeData
Whether or not to normalize float data.
Definition: FormatReader.h:186
dimension_size_type getSizeZ() const
Get the size of the Z dimension.
Definition: FormatReader.cpp:513
bool isFalseColor() const
Get whether the image planes are false color.
Definition: FormatReader.cpp:580
bool saveOriginalMetadata
Whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.h:192
const MetadataMap & getSeriesMetadata() const
Get series metadata map.
Definition: FormatReader.cpp:1047
ome::compat::shared_ptr< std::istream > in
Current input.
Definition: FormatReader.h:123
dimension_size_type resolution
The number of the current resolution.
Definition: FormatReader.h:161
bool isOriginalMetadataPopulated() const
Get proprietary metadata storage.
Definition: FormatReader.cpp:868
bool isIndexed() const
Get whether the image planes are indexed color.
Definition: FormatReader.cpp:573
dimension_size_type getOptimalTileHeight() const
Get the optimal sub-image height.
Definition: FormatReader.cpp:1172
bool group
Whether or not to group multi-file formats.
Definition: FormatReader.h:198
const std::vector< std::string > & getPossibleDomains(const std::string &id) const
Get the possible domains represented in which this format is used.
Definition: FormatReader.cpp:1127
boost::optional< boost::filesystem::path > currentId
The identifier (path) of the currently open file.
Definition: FormatReader.h:120
bool hasCompanionFiles() const
Does this format support multi-file datasets?
Definition: FormatReader.cpp:1121
const std::string & getFormat() const
Get the name of this file format.
Definition: FormatReader.cpp:112
PixelType enumeration.
Definition: PixelType.h:70
FileGroupOption
File grouping options.
Definition: FormatReader.h:77
dimension_size_type getIndex(dimension_size_type z, dimension_size_type c, dimension_size_type t) const
Get the linear index of a Z, C and T coordinate.
Definition: FormatReader.cpp:966
const MetadataOptions & getMetadataOptions() const
Get metadata options.
Definition: FormatReader.cpp:408
std::vector< boost::filesystem::path > compression_suffixes
Filename compression suffixes this format can handle.
Definition: FormatReader.h:75
Modulo & getModuloZ()
Get the Modulo subdivision of the Z dimension.
Definition: FormatReader.cpp:596
virtual void initFile(const boost::filesystem::path &id)
Initialize the given file.
Definition: FormatReader.cpp:142
const std::vector< boost::filesystem::path > & getCompressionSuffixes() const
Get the default compression suffixes for this file format.
Definition: FormatReader.cpp:130
const std::vector< std::string > & getDomains() const
Get the domains represented by the current file.
Definition: FormatReader.cpp:1133
const MetadataMap & getGlobalMetadata() const
Get global metadata map.
Definition: FormatReader.cpp:1041
dimension_size_type getThumbSizeX() const
Get the thumbnail size of the X dimension.
Definition: FormatReader.cpp:676
FormatReader & operator=(const FormatReader &)
Assignment operator (deleted).
dimension_size_type series
The number of the current series (non-flattened).
Definition: FormatReader.h:142
dimension_size_type getRGBChannelCount(dimension_size_type channel) const
Get the number of channels returned for a call to openBytes().
Definition: FormatReader.cpp:567
virtual ~FormatReader()
Destructor.
Definition: FormatReader.cpp:107
void setMetadataOptions(const MetadataOptions &options)
Set metadata options.
Definition: FormatReader.cpp:402
ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > metadataStore
Current metadata store.
Definition: FormatReader.h:207
dimension_size_type getOptimalTileWidth() const
Get the optimal sub-image width.
Definition: FormatReader.cpp:1159
void setResolution(dimension_size_type resolution) const
Set the active resolution level.
Definition: FormatReader.cpp:1304
Modulo & getModuloT()
Get the Modulo subdivision of the T dimension.
Definition: FormatReader.cpp:608
virtual ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > makeFilterMetadata()
Create a configured FilterMetadata instance.
Definition: FormatReader.cpp:393
Buffer for all pixel types.
Definition: VariantPixelBuffer.h:72
bool indexedAsRGB
Whether or not MetadataStore sets C = 3 for indexed color images.
Definition: FormatReader.h:195
uint32_t getRequiredDirectories(const std::vector< std::string > &files) const
Get required parent directories.
Definition: FormatReader.cpp:1109
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore() const
Get the current metadata store for this reader.
Definition: FormatReader.cpp:1085
dimension_size_type coreIndex
The number of the current series (flattened).
Definition: FormatReader.h:134
bool isGroupFiles() const
Get file grouping.
Definition: FormatReader.cpp:829
dimension_size_type getResolutionCount() const
Get the number of resolutions for the current series.
Definition: FormatReader.cpp:1292
const std::set< MetadataOptions::MetadataLevel > & getSupportedMetadataLevels()
Get the supported metadata levels.
Definition: FormatReader.cpp:136
const std::string & getDatasetStructureDescription() const
Get a short description of the dataset structure.
Definition: FormatReader.cpp:1115
bool isMetadataFiltered() const
Get metadata filtering.
Definition: FormatReader.cpp:1068
void setSeries(dimension_size_type series) const
Set the active series.
Definition: FormatReader.cpp:784
dimension_size_type getSizeT() const
Get the size of the T dimension.
Definition: FormatReader.cpp:520
std::size_t dimension_size_type
Size type for image dimensions.
Definition: Types.h:59
std::set< MetadataOptions::MetadataLevel > metadata_levels
Supported metadata levels. A typical default is {METADATA_MINIMUM,METADATA_NO_OVERLAYS,METADATA_ALL}.
Definition: FormatReader.h:77
dimension_size_type getSeries() const
Get the active series.
Definition: FormatReader.cpp:793
bool hasFlattenedResolutions() const
Get resolution flattening.
Definition: FormatReader.cpp:1325
dimension_size_type getSizeX() const
Get the size of the X dimension.
Definition: FormatReader.cpp:499
dimension_size_type getThumbSizeY() const
Get the thumbnail size of the Y dimension.
Definition: FormatReader.cpp:682
virtual bool isUsedFile(const boost::filesystem::path &file)
Check if a file is in the used files list.
Definition: FormatReader.cpp:170
bool suffixSufficient
Whether the file extension matching one of the reader's suffixes is sufficient to identify the file a...
Definition: FormatReader.h:177
bool suffixNecessary
Whether the file extension matching one of the reader's suffixes is necessary to identify the file as...
Definition: FormatReader.h:171