bioformats  5.1.1
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 
145  coremetadata_list_type core;
146 
154 
157 
164 
170 
173 
175  std::string datasetDescription;
176 
179 
182 
185 
188 
190  bool group;
191 
193  std::vector<std::string> domains;
194 
199  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore> metadataStore;
200 
203 
206 
207  public:
209  virtual
210  ~FormatReader();
211 
212  private:
214  FormatReader (const FormatReader&);
215 
217  FormatReader&
218  operator= (const FormatReader&);
219 
220  protected:
235  virtual
236  void
237  initFile(const boost::filesystem::path& id);
238 
245  virtual
246  bool
247  isUsedFile(const boost::filesystem::path& file);
248 
263  virtual
264  void
265  readPlane(std::istream& source,
266  VariantPixelBuffer& dest,
271  dimension_size_type samples);
272 
288  virtual
289  void
290  readPlane(std::istream& source,
291  VariantPixelBuffer& dest,
296  dimension_size_type scanlinePad,
297  dimension_size_type samples);
298 
307  virtual
308  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>
310 
319  const CoreMetadata&
321  {
322  coremetadata_list_type::value_type cm(core.at(index));
323  if (!cm)
324  throw std::logic_error("CoreMetadata null");
325  return *cm;
326  }
327 
336  CoreMetadata&
338  {
339  coremetadata_list_type::value_type cm(core.at(index));
340  if (!cm)
341  throw std::logic_error("CoreMetadata null");
342  return *cm;
343  }
344 
345  public:
346  // Documented in superclass.
347  const std::set<MetadataOptions::MetadataLevel>&
349 
350  // Documented in superclass.
351  void
352  setMetadataOptions(const MetadataOptions& options);
353 
354  // Documented in superclass.
355  const MetadataOptions&
356  getMetadataOptions() const;
357 
360 
361  // Documented in superclass.
362  const MetadataMap&
363  getGlobalMetadata() const;
364 
365  // Documented in superclass.
367  getMetadataValue(const std::string& field) const;
368 
369  // Documented in superclass.
370  const MetadataMap&
371  getSeriesMetadata() const;
372 
373  // Documented in superclass.
375  getSeriesMetadataValue(const MetadataMap::key_type& field) const;
376 
377  // Documented in superclass.
378  bool
379  isThisType(const boost::filesystem::path& name,
380  bool open = true) const;
381 
382  // Documented in superclass.
383  bool
384  isThisType(const uint8_t *begin,
385  std::size_t length) const;
386 
387  // Documented in superclass.
388  bool
389  isThisType(const uint8_t *begin,
390  const uint8_t *end) const;
391 
392  // Documented in superclass.
393  bool
394  isThisType(std::istream& stream) const;
395 
396  protected:
409  virtual
410  bool
411  isFilenameThisTypeImpl(const boost::filesystem::path& name) const;
412 
425  virtual
426  bool
427  isStreamThisTypeImpl(std::istream& stream) const;
428 
429  public:
430  // Documented in superclass.
432  getImageCount() const;
433 
434  // Documented in superclass.
435  bool
436  isRGB(dimension_size_type channel) const;
437 
438  // Documented in superclass.
440  getSizeX() const;
441 
442  // Documented in superclass.
444  getSizeY() const;
445 
446  // Documented in superclass.
448  getSizeZ() const;
449 
450  // Documented in superclass.
452  getSizeT() const;
453 
454  // Documented in superclass.
456  getSizeC() const;
457 
458  // Documented in superclass.
460  getPixelType() const;
461 
462  // Documented in superclass.
464  getBitsPerPixel() const;
465 
466  // Documented in superclass.
468  getEffectiveSizeC() const;
469 
470  // Documented in superclass.
473 
474  // Documented in superclass.
475  bool
476  isIndexed() const;
477 
478  // Documented in superclass.
479  bool
480  isFalseColor() const;
481 
482  // Documented in superclass.
483  void
485  VariantPixelBuffer& buf) const;
486 
487  // Documented in superclass.
488  Modulo&
489  getModuloZ();
490 
491  // Documented in superclass.
492  const Modulo&
493  getModuloZ() const;
494 
495  // Documented in superclass.
496  Modulo&
497  getModuloT();
498 
499  // Documented in superclass.
500  const Modulo&
501  getModuloT() const;
502 
503  // Documented in superclass.
504  Modulo&
505  getModuloC();
506 
507  // Documented in superclass.
508  const Modulo&
509  getModuloC() const;
510 
511  protected:
518  ome::compat::array<dimension_size_type, 2>
519  getThumbSize() const;
520 
521  public:
522  // Documented in superclass.
524  getThumbSizeX() const;
525 
526  // Documented in superclass.
528  getThumbSizeY() const;
529 
530  // Documented in superclass.
531  bool
532  isLittleEndian() const;
533 
534  // Documented in superclass.
535  const std::string&
536  getDimensionOrder() const;
537 
538  // Documented in superclass.
539  bool
540  isOrderCertain() const;
541 
542  // Documented in superclass.
543  bool
544  isThumbnailSeries() const;
545 
546  // Documented in superclass.
547  bool
548  isInterleaved() const;
549 
550  // Documented in superclass.
551  bool
553 
554  // Documented in superclass.
555  void
557  VariantPixelBuffer& buf) const;
558 
559  // Documented in superclass.
560  void
562  VariantPixelBuffer& buf,
566  dimension_size_type h) const;
567 
568  protected:
572  virtual
573  void
575  VariantPixelBuffer& buf,
579  dimension_size_type h) const = 0;
580 
581  public:
582  // Documented in superclass.
583  void
585  VariantPixelBuffer& buf) const;
586 
587  // Documented in superclass.
588  void
589  close(bool fileOnly = false);
590 
591  // Documented in superclass.
593  getSeriesCount() const;
594 
595  // Documented in superclass.
596  void
597  setSeries(dimension_size_type series) const;
598 
599  // Documented in superclass.
601  getSeries() const;
602 
603  // Documented in superclass.
604  void
605  setGroupFiles(bool group);
606 
607  // Documented in superclass.
608  bool
609  isGroupFiles() const;
610 
611  // Documented in superclass.
613  fileGroupOption(const std::string& id);
614 
615  // Documented in superclass.
616  bool
617  isMetadataComplete() const;
618 
619  // Documented in superclass.
620  void
621  setNormalized(bool normalize);
622 
623  // Documented in superclass.
624  bool
625  isNormalized() const;
626 
627  // Documented in superclass.
628  void
629  setOriginalMetadataPopulated(bool populate);
630 
631  // Documented in superclass.
632  bool
634 
635  // Documented in superclass.
636  const std::vector<boost::filesystem::path>
637  getUsedFiles(bool noPixels = false) const;
638 
639  // Documented in superclass.
640  const std::vector<boost::filesystem::path>
641  getSeriesUsedFiles(bool noPixels = false) const;
642 
643  // Documented in superclass.
644  std::vector<FileInfo>
645  getAdvancedUsedFiles(bool noPixels = false) const;
646 
647  // Documented in superclass.
648  std::vector<FileInfo>
649  getAdvancedSeriesUsedFiles(bool noPixels = false) const;
650 
651  // Documented in superclass.
652  const boost::optional<boost::filesystem::path>&
653  getCurrentFile() const;
654 
655  // Documented in superclass.
659  dimension_size_type t) const;
660 
661  // Documented in superclass.
666  dimension_size_type moduloZ,
667  dimension_size_type moduloC,
668  dimension_size_type moduloT) const;
669 
670  // Documented in superclass.
671  ome::compat::array<dimension_size_type, 3>
672  getZCTCoords(dimension_size_type index) const;
673 
674  // Documented in superclass.
675  ome::compat::array<dimension_size_type, 6>
677 
678  // Documented in superclass.
679  const std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> >&
680  getCoreMetadataList() const;
681 
682  // Documented in superclass.
683  void
684  setMetadataFiltered(bool filter);
685 
686  // Documented in superclass.
687  bool
688  isMetadataFiltered() const;
689 
690  // Documented in superclass.
691  void
692  setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>& store);
693 
694  // Documented in superclass.
695  const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
696  getMetadataStore() const;
697 
698  // Documented in superclass.
699  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
701 
702  // Documented in superclass.
703  std::vector<ome::compat::shared_ptr< ::ome::bioformats::FormatReader> >
704  getUnderlyingReaders() const;
705 
706  // Documented in superclass.
707  bool
708  isSingleFile(const boost::filesystem::path& id) const;
709 
710  // Documented in superclass.
711  uint32_t
712  getRequiredDirectories(const std::vector<std::string>& files) const;
713 
714  // Documented in superclass.
715  const std::string&
717 
718  // Documented in superclass.
719  const std::vector<std::string>&
720  getPossibleDomains(const std::string& id) const;
721 
722  // Documented in superclass.
723  bool
724  hasCompanionFiles() const;
725 
726  // Documented in superclass.
727  const std::vector<std::string>&
728  getDomains() const;
729 
730  // Documented in superclass.
733 
734  // Documented in superclass.
737 
738  // Documented in superclass.
740  getOptimalTileWidth() const;
741 
742  // Documented in superclass.
744  getOptimalTileHeight() const;
745 
746  // Documented in superclass.
749 
750  // Documented in superclass.
753 
754  // Documented in superclass.
756  getCoreIndex() const;
757 
758  // Documented in superclass.
759  void
760  setCoreIndex(dimension_size_type index) const;
761 
762  // Documented in superclass.
764  getResolutionCount() const;
765 
766  // Documented in superclass.
767  void
768  setResolution(dimension_size_type resolution) const;
769 
770  // Documented in superclass.
772  getResolution() const;
773 
774  // Documented in superclass.
775  bool
776  hasFlattenedResolutions() const;
777 
778  // Documented in superclass.
779  void
780  setFlattenedResolutions(bool flatten);
781 
782  // Documented in superclass.
783  void
784  setId(const boost::filesystem::path& id);
785 
786  // Documented in superclass.
787  const std::string&
788  getFormat() const;
789 
790  // Documented in superclass.
791  const std::string&
792  getFormatDescription() const;
793 
794  // Documented in superclass.
795  const std::vector<boost::filesystem::path>&
796  getSuffixes() const;
797 
798  // Documented in superclass.
799  const std::vector<boost::filesystem::path>&
800  getCompressionSuffixes() const;
801  };
802 
803  }
804  }
805 }
806 
807 #endif // OME_BIOFORMATS_DETAIL_FORMATREADER_H
808 
809 /*
810  * Local Variables:
811  * mode:C++
812  * End:
813  */
bool isLittleEndian() const
Get whether the data is in little-endian format.
Definition: FormatReader.cpp:687
bool isMetadataComplete() const
Get status of metadata parsing.
Definition: FormatReader.cpp:815
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:536
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:123
Modulo & getModuloC()
Get the Modulo subdivision of the C dimension.
Definition: FormatReader.cpp:619
bool isSingleFile(const boost::filesystem::path &id) const
Is this a single-file format?
Definition: FormatReader.cpp:1077
void openThumbBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain a thumbnail of an image plane.
Definition: FormatReader.cpp:746
const std::vector< boost::filesystem::path > getSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:867
const std::string & getFormatDescription() const
Get the description of this file format.
Definition: FormatReader.cpp:117
bool isThumbnailSeries() const
Get whether the current series is a lower resolution copy of a different series.
Definition: FormatReader.cpp:708
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:809
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:505
const boost::optional< boost::filesystem::path > & getCurrentFile() const
Get the currently open file.
Definition: FormatReader.cpp:934
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:631
void setCoreIndex(dimension_size_type index) const
Set the current resolution/series (ignoring sub-resolutions).
Definition: FormatReader.cpp:1317
const CoreMetadata & getCoreMetadata(dimension_size_type index) const
Get CoreMetadata by core index.
Definition: FormatReader.h:320
dimension_size_type seriesToCoreIndex(dimension_size_type series) const
Get the first core index corresponding to the specified series.
Definition: FormatReader.cpp:1159
dimension_size_type getResolution() const
Get the active resolution level.
Definition: FormatReader.cpp:1292
MetadataOptions metadataOptions
Metadata parsing options.
Definition: FormatReader.h:202
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:419
std::vector< FileInfo > getAdvancedSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:905
Interface for all biological file format readers.
Definition: FormatReader.h:70
void getLookupTable(dimension_size_type plane, VariantPixelBuffer &buf) const
Get the color lookup table associated with an image plane.
Definition: FormatReader.cpp:586
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:987
bool companionFiles
Whether this format supports multi-file datasets.
Definition: FormatReader.h:172
void openBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain an image plane.
Definition: FormatReader.cpp:728
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:975
std::vector< std::string > domains
List of domains in which this format is used.
Definition: FormatReader.h:193
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:491
void setGroupFiles(bool group)
Set file grouping.
Definition: FormatReader.cpp:796
void setMetadataFiltered(bool filter)
Set metadata filtering.
Definition: FormatReader.cpp:1035
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:1048
pixel_size_type getBitsPerPixel() const
Get the number of valid bits per pixel.
Definition: FormatReader.cpp:543
std::vector< ome::compat::shared_ptr< ::ome::bioformats::FormatReader > > getUnderlyingReaders() const
Get all underlying readers.
Definition: FormatReader.cpp:1071
void setId(const boost::filesystem::path &id)
Set the current file name.
Definition: FormatReader.cpp:1331
::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:848
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:205
void setNormalized(bool normalize)
Set float normalization.
Definition: FormatReader.cpp:822
FormatReader()
Constructor.
Definition: FormatReader.h:136
dimension_size_type getSeriesCount() const
Get the number of image series in this file.
Definition: FormatReader.cpp:771
virtual bool isFilenameThisTypeImpl(const boost::filesystem::path &name) const
isThisType file implementation for readers.
Definition: FormatReader.cpp:472
Metadata options.
Definition: MetadataOptions.h:55
void setFlattenedResolutions(bool flatten)
Set resolution flattening.
Definition: FormatReader.cpp:1304
void setOriginalMetadataPopulated(bool populate)
Specifies whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.cpp:835
virtual bool isStreamThisTypeImpl(std::istream &stream) const
isThisType stream implementation for readers.
Definition: FormatReader.cpp:478
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:758
dimension_size_type getSizeC() const
Get the size of the C dimension.
Definition: FormatReader.cpp:526
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:715
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:156
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:1028
bool isNormalized() const
Get float normalization.
Definition: FormatReader.cpp:829
std::string key_type
Key type.
Definition: MetadataMap.h:147
CoreMetadata & getCoreMetadata(dimension_size_type index)
Get CoreMetadata by core index.
Definition: FormatReader.h:337
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:1217
coremetadata_list_type core
Core metadata values.
Definition: FormatReader.h:145
const MetadataMap::value_type & getMetadataValue(const std::string &field) const
Get a global metadata value.
Definition: FormatReader.cpp:1002
bool isOrderCertain() const
Get whether the dimension order and sizes are known, or merely guesses.
Definition: FormatReader.cpp:701
const MetadataMap::value_type & getSeriesMetadataValue(const MetadataMap::key_type &field) const
Get a series metadata value.
Definition: FormatReader.cpp:1008
const std::string & getDimensionOrder() const
Get the dimension order.
Definition: FormatReader.cpp:694
dimension_size_type getEffectiveSizeC() const
Get the effective size of the C dimension.
Definition: FormatReader.cpp:560
dimension_size_type getCoreIndex() const
Get the CoreMetadata index of the current resolution/series.
Definition: FormatReader.cpp:1311
std::vector< FileInfo > getAdvancedUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:876
bool filterMetadata
Whether or not to filter out invalid metadata.
Definition: FormatReader.h:181
std::string datasetDescription
Short description of the structure of the dataset.
Definition: FormatReader.h:175
dimension_size_type getImageCount() const
Determine the number of image planes in the current series.
Definition: FormatReader.cpp:484
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:178
dimension_size_type getSizeZ() const
Get the size of the Z dimension.
Definition: FormatReader.cpp:512
bool isFalseColor() const
Get whether the image planes are false color.
Definition: FormatReader.cpp:579
bool saveOriginalMetadata
Whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.h:184
const MetadataMap & getSeriesMetadata() const
Get series metadata map.
Definition: FormatReader.cpp:1021
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:153
bool isOriginalMetadataPopulated() const
Get proprietary metadata storage.
Definition: FormatReader.cpp:842
bool isIndexed() const
Get whether the image planes are indexed color.
Definition: FormatReader.cpp:572
dimension_size_type getOptimalTileHeight() const
Get the optimal sub-image height.
Definition: FormatReader.cpp:1146
bool group
Whether or not to group multi-file formats.
Definition: FormatReader.h:190
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:1101
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:1095
const std::string & getFormat() const
Get the name of this file format.
Definition: FormatReader.cpp:111
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:940
const MetadataOptions & getMetadataOptions() const
Get metadata options.
Definition: FormatReader.cpp:407
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:595
virtual void initFile(const boost::filesystem::path &id)
Initialize the given file.
Definition: FormatReader.cpp:141
const std::vector< boost::filesystem::path > & getCompressionSuffixes() const
Get the default compression suffixes for this file format.
Definition: FormatReader.cpp:129
const std::vector< std::string > & getDomains() const
Get the domains represented by the current file.
Definition: FormatReader.cpp:1107
const MetadataMap & getGlobalMetadata() const
Get global metadata map.
Definition: FormatReader.cpp:1015
dimension_size_type getThumbSizeX() const
Get the thumbnail size of the X dimension.
Definition: FormatReader.cpp:675
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:566
virtual ~FormatReader()
Destructor.
Definition: FormatReader.cpp:106
void setMetadataOptions(const MetadataOptions &options)
Set metadata options.
Definition: FormatReader.cpp:401
ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > metadataStore
Current metadata store.
Definition: FormatReader.h:199
dimension_size_type getOptimalTileWidth() const
Get the optimal sub-image width.
Definition: FormatReader.cpp:1133
void setResolution(dimension_size_type resolution) const
Set the active resolution level.
Definition: FormatReader.cpp:1278
Modulo & getModuloT()
Get the Modulo subdivision of the T dimension.
Definition: FormatReader.cpp:607
virtual ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > makeFilterMetadata()
Create a configured FilterMetadata instance.
Definition: FormatReader.cpp:392
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:187
uint32_t getRequiredDirectories(const std::vector< std::string > &files) const
Get required parent directories.
Definition: FormatReader.cpp:1083
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore() const
Get the current metadata store for this reader.
Definition: FormatReader.cpp:1059
dimension_size_type coreIndex
The number of the current series (flattened).
Definition: FormatReader.h:134
bool isGroupFiles() const
Get file grouping.
Definition: FormatReader.cpp:803
dimension_size_type getResolutionCount() const
Get the number of resolutions for the current series.
Definition: FormatReader.cpp:1266
const std::set< MetadataOptions::MetadataLevel > & getSupportedMetadataLevels()
Get the supported metadata levels.
Definition: FormatReader.cpp:135
const std::string & getDatasetStructureDescription() const
Get a short description of the dataset structure.
Definition: FormatReader.cpp:1089
bool isMetadataFiltered() const
Get metadata filtering.
Definition: FormatReader.cpp:1042
void setSeries(dimension_size_type series) const
Set the active series.
Definition: FormatReader.cpp:782
dimension_size_type getSizeT() const
Get the size of the T dimension.
Definition: FormatReader.cpp:519
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:790
bool hasFlattenedResolutions() const
Get resolution flattening.
Definition: FormatReader.cpp:1298
dimension_size_type getSizeX() const
Get the size of the X dimension.
Definition: FormatReader.cpp:498
dimension_size_type getThumbSizeY() const
Get the thumbnail size of the Y dimension.
Definition: FormatReader.cpp:681
virtual bool isUsedFile(const boost::filesystem::path &file)
Check if a file is in the used files list.
Definition: FormatReader.cpp:169
bool suffixSufficient
Whether the file extension matching one of the reader's suffixes is sufficient to identify the file a...
Definition: FormatReader.h:169
bool suffixNecessary
Whether the file extension matching one of the reader's suffixes is necessary to identify the file as...
Definition: FormatReader.h:163