bioformats  5.1.5
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 <ome/bioformats/FormatReader.h>
46 #include <ome/bioformats/FormatHandler.h>
47 
48 namespace ome
49 {
50  namespace bioformats
51  {
58  namespace detail
59  {
60 
65  {
67  std::string name;
69  std::string description;
71  std::vector<boost::filesystem::path> suffixes;
73  std::vector<boost::filesystem::path> compression_suffixes;
75  std::set<MetadataOptions::MetadataLevel> metadata_levels;
76 
83  ReaderProperties(const std::string& name,
84  const std::string& description):
85  name(name),
86  description(description),
87  suffixes(),
88  compression_suffixes(),
89  metadata_levels()
90  {
91  compression_suffixes.push_back(boost::filesystem::path(""));
92  }
93  };
94 
108  virtual public ::ome::bioformats::FormatHandler
109  {
110  protected:
112  typedef std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> > coremetadata_list_type;
113 
116 
118  boost::optional<boost::filesystem::path> currentId;
119 
121  ome::compat::shared_ptr<std::istream> in;
122 
125 
133 
141 
149 
151  coremetadata_list_type core;
152 
160 
163 
170 
176 
179 
181  std::string datasetDescription;
182 
185 
188 
191 
194 
196  bool group;
197 
199  std::vector<std::string> domains;
200 
205  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore> metadataStore;
206 
209 
212 
213  public:
215  virtual
216  ~FormatReader();
217 
218  private:
220  FormatReader (const FormatReader&);
221 
223  FormatReader&
224  operator= (const FormatReader&);
225 
226  protected:
241  virtual
242  void
243  initFile(const boost::filesystem::path& id);
244 
251  virtual
252  bool
253  isUsedFile(const boost::filesystem::path& file);
254 
269  virtual
270  void
271  readPlane(std::istream& source,
272  VariantPixelBuffer& dest,
277  dimension_size_type samples);
278 
294  virtual
295  void
296  readPlane(std::istream& source,
297  VariantPixelBuffer& dest,
302  dimension_size_type scanlinePad,
303  dimension_size_type samples);
304 
313  virtual
314  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>
316 
325  const CoreMetadata&
327  {
328  coremetadata_list_type::value_type cm(core.at(index));
329  if (!cm)
330  throw std::logic_error("CoreMetadata null");
331  return *cm;
332  }
333 
342  CoreMetadata&
344  {
345  coremetadata_list_type::value_type cm(core.at(index));
346  if (!cm)
347  throw std::logic_error("CoreMetadata null");
348  return *cm;
349  }
350 
351  public:
352  // Documented in superclass.
353  const std::set<MetadataOptions::MetadataLevel>&
355 
356  // Documented in superclass.
357  void
358  setMetadataOptions(const MetadataOptions& options);
359 
360  // Documented in superclass.
361  const MetadataOptions&
362  getMetadataOptions() const;
363 
366 
367  // Documented in superclass.
368  const MetadataMap&
369  getGlobalMetadata() const;
370 
371  // Documented in superclass.
373  getMetadataValue(const std::string& field) const;
374 
375  // Documented in superclass.
376  const MetadataMap&
377  getSeriesMetadata() const;
378 
379  // Documented in superclass.
381  getSeriesMetadataValue(const MetadataMap::key_type& field) const;
382 
383  // Documented in superclass.
384  bool
385  isThisType(const boost::filesystem::path& name,
386  bool open = true) const;
387 
388  // Documented in superclass.
389  bool
390  isThisType(const uint8_t *begin,
391  std::size_t length) const;
392 
393  // Documented in superclass.
394  bool
395  isThisType(const uint8_t *begin,
396  const uint8_t *end) const;
397 
398  // Documented in superclass.
399  bool
400  isThisType(std::istream& stream) const;
401 
402  protected:
415  virtual
416  bool
417  isFilenameThisTypeImpl(const boost::filesystem::path& name) const;
418 
431  virtual
432  bool
433  isStreamThisTypeImpl(std::istream& stream) const;
434 
435  public:
436  // Documented in superclass.
438  getImageCount() const;
439 
440  // Documented in superclass.
441  bool
442  isRGB(dimension_size_type channel) const;
443 
444  // Documented in superclass.
446  getSizeX() const;
447 
448  // Documented in superclass.
450  getSizeY() const;
451 
452  // Documented in superclass.
454  getSizeZ() const;
455 
456  // Documented in superclass.
458  getSizeT() const;
459 
460  // Documented in superclass.
462  getSizeC() const;
463 
464  // Documented in superclass.
466  getPixelType() const;
467 
468  // Documented in superclass.
470  getBitsPerPixel() const;
471 
472  // Documented in superclass.
474  getEffectiveSizeC() const;
475 
476  // Documented in superclass.
479 
480  // Documented in superclass.
481  bool
482  isIndexed() const;
483 
484  // Documented in superclass.
485  bool
486  isFalseColor() const;
487 
488  // Documented in superclass.
489  void
491  VariantPixelBuffer& buf) const;
492 
493  // Documented in superclass.
494  Modulo&
495  getModuloZ();
496 
497  // Documented in superclass.
498  const Modulo&
499  getModuloZ() const;
500 
501  // Documented in superclass.
502  Modulo&
503  getModuloT();
504 
505  // Documented in superclass.
506  const Modulo&
507  getModuloT() const;
508 
509  // Documented in superclass.
510  Modulo&
511  getModuloC();
512 
513  // Documented in superclass.
514  const Modulo&
515  getModuloC() const;
516 
517  protected:
524  ome::compat::array<dimension_size_type, 2>
525  getThumbSize() const;
526 
527  public:
528  // Documented in superclass.
530  getThumbSizeX() const;
531 
532  // Documented in superclass.
534  getThumbSizeY() const;
535 
536  // Documented in superclass.
537  bool
538  isLittleEndian() const;
539 
540  // Documented in superclass.
541  const std::string&
542  getDimensionOrder() const;
543 
544  // Documented in superclass.
545  bool
546  isOrderCertain() const;
547 
548  // Documented in superclass.
549  bool
550  isThumbnailSeries() const;
551 
552  // Documented in superclass.
553  bool
554  isInterleaved() const;
555 
556  // Documented in superclass.
557  bool
559 
560  // Documented in superclass.
561  void
563  VariantPixelBuffer& buf) const;
564 
565  // Documented in superclass.
566  void
568  VariantPixelBuffer& buf,
572  dimension_size_type h) const;
573 
574  protected:
578  virtual
579  void
581  VariantPixelBuffer& buf,
585  dimension_size_type h) const = 0;
586 
587  public:
588  // Documented in superclass.
589  void
591  VariantPixelBuffer& buf) const;
592 
593  // Documented in superclass.
594  void
595  close(bool fileOnly = false);
596 
597  // Documented in superclass.
599  getSeriesCount() const;
600 
601  // Documented in superclass.
602  void
603  setSeries(dimension_size_type series) const;
604 
605  // Documented in superclass.
607  getSeries() const;
608 
609  // Documented in superclass.
610  void
611  setPlane(dimension_size_type plane) const;
612 
613  // Documented in superclass.
615  getPlane() const;
616 
617  // Documented in superclass.
618  void
619  setGroupFiles(bool group);
620 
621  // Documented in superclass.
622  bool
623  isGroupFiles() const;
624 
625  // Documented in superclass.
627  fileGroupOption(const std::string& id);
628 
629  // Documented in superclass.
630  bool
631  isMetadataComplete() const;
632 
633  // Documented in superclass.
634  void
635  setNormalized(bool normalize);
636 
637  // Documented in superclass.
638  bool
639  isNormalized() const;
640 
641  // Documented in superclass.
642  void
643  setOriginalMetadataPopulated(bool populate);
644 
645  // Documented in superclass.
646  bool
648 
649  // Documented in superclass.
650  const std::vector<boost::filesystem::path>
651  getUsedFiles(bool noPixels = false) const;
652 
653  // Documented in superclass.
654  const std::vector<boost::filesystem::path>
655  getSeriesUsedFiles(bool noPixels = false) const;
656 
657  // Documented in superclass.
658  std::vector<FileInfo>
659  getAdvancedUsedFiles(bool noPixels = false) const;
660 
661  // Documented in superclass.
662  std::vector<FileInfo>
663  getAdvancedSeriesUsedFiles(bool noPixels = false) const;
664 
665  // Documented in superclass.
666  const boost::optional<boost::filesystem::path>&
667  getCurrentFile() const;
668 
669  // Documented in superclass.
673  dimension_size_type t) const;
674 
675  // Documented in superclass.
680  dimension_size_type moduloZ,
681  dimension_size_type moduloC,
682  dimension_size_type moduloT) const;
683 
684  // Documented in superclass.
685  ome::compat::array<dimension_size_type, 3>
686  getZCTCoords(dimension_size_type index) const;
687 
688  // Documented in superclass.
689  ome::compat::array<dimension_size_type, 6>
691 
692  // Documented in superclass.
693  const std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> >&
694  getCoreMetadataList() const;
695 
696  // Documented in superclass.
697  void
698  setMetadataFiltered(bool filter);
699 
700  // Documented in superclass.
701  bool
702  isMetadataFiltered() const;
703 
704  // Documented in superclass.
705  void
706  setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>& store);
707 
708  // Documented in superclass.
709  const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
710  getMetadataStore() const;
711 
712  // Documented in superclass.
713  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
715 
716  // Documented in superclass.
717  std::vector<ome::compat::shared_ptr< ::ome::bioformats::FormatReader> >
718  getUnderlyingReaders() const;
719 
720  // Documented in superclass.
721  bool
722  isSingleFile(const boost::filesystem::path& id) const;
723 
724  // Documented in superclass.
725  uint32_t
726  getRequiredDirectories(const std::vector<std::string>& files) const;
727 
728  // Documented in superclass.
729  const std::string&
731 
732  // Documented in superclass.
733  const std::vector<std::string>&
734  getPossibleDomains(const std::string& id) const;
735 
736  // Documented in superclass.
737  bool
738  hasCompanionFiles() const;
739 
740  // Documented in superclass.
741  const std::vector<std::string>&
742  getDomains() const;
743 
744  // Documented in superclass.
747 
748  // Documented in superclass.
751 
752  // Documented in superclass.
754  getOptimalTileWidth() const;
755 
756  // Documented in superclass.
758  getOptimalTileHeight() const;
759 
760  // Documented in superclass.
763 
764  // Documented in superclass.
767 
768  // Documented in superclass.
770  getCoreIndex() const;
771 
772  // Documented in superclass.
773  void
774  setCoreIndex(dimension_size_type index) const;
775 
776  // Documented in superclass.
778  getResolutionCount() const;
779 
780  // Documented in superclass.
781  void
782  setResolution(dimension_size_type resolution) const;
783 
784  // Documented in superclass.
786  getResolution() const;
787 
788  // Documented in superclass.
789  bool
790  hasFlattenedResolutions() const;
791 
792  // Documented in superclass.
793  void
794  setFlattenedResolutions(bool flatten);
795 
796  // Documented in superclass.
797  void
798  setId(const boost::filesystem::path& id);
799 
800  // Documented in superclass.
801  const std::string&
802  getFormat() const;
803 
804  // Documented in superclass.
805  const std::string&
806  getFormatDescription() const;
807 
808  // Documented in superclass.
809  const std::vector<boost::filesystem::path>&
810  getSuffixes() const;
811 
812  // Documented in superclass.
813  const std::vector<boost::filesystem::path>&
814  getCompressionSuffixes() const;
815  };
816 
817  }
818  }
819 }
820 
821 #endif // OME_BIOFORMATS_DETAIL_FORMATREADER_H
822 
823 /*
824  * Local Variables:
825  * mode:C++
826  * End:
827  */
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:107
ome::xml::model::enums::PixelType getPixelType() const
Get the pixel type.
Definition: FormatReader.cpp:537
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:69
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:64
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:326
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:208
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:178
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:199
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:83
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:124
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:71
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:147
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:115
bool flattenedResolutions
Whether or not resolutions are flattened.
Definition: FormatReader.h:162
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:144
CoreMetadata & getCoreMetadata(dimension_size_type index)
Get CoreMetadata by core index.
Definition: FormatReader.h:343
dimension_size_type plane
The number of the current plane in the current series.
Definition: FormatReader.h:148
std::string name
Format name.
Definition: FormatReader.h:67
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:151
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:187
std::string datasetDescription
Short description of the structure of the dataset.
Definition: FormatReader.h:181
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.
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:112
bool normalizeData
Whether or not to normalize float data.
Definition: FormatReader.h:184
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:190
const MetadataMap & getSeriesMetadata() const
Get series metadata map.
Definition: FormatReader.cpp:1047
ome::compat::shared_ptr< std::istream > in
Current input.
Definition: FormatReader.h:121
dimension_size_type resolution
The number of the current resolution.
Definition: FormatReader.h:159
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:196
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:118
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:69
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:73
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:140
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:205
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:75
bool indexedAsRGB
Whether or not MetadataStore sets C = 3 for indexed color images.
Definition: FormatReader.h:193
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:132
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:75
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:175
bool suffixNecessary
Whether the file extension matching one of the reader's suffixes is necessary to identify the file as...
Definition: FormatReader.h:169