bioformats  5.1.0
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 
262  virtual
263  void
264  readPlane(std::istream& source,
265  VariantPixelBuffer& dest,
270 
285  virtual
286  void
287  readPlane(std::istream& source,
288  VariantPixelBuffer& dest,
293  dimension_size_type scanlinePad);
294 
303  virtual
304  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>
306 
315  const CoreMetadata&
317  {
318  coremetadata_list_type::value_type cm(core.at(index));
319  if (!cm)
320  throw std::logic_error("CoreMetadata null");
321  return *cm;
322  }
323 
332  CoreMetadata&
334  {
335  coremetadata_list_type::value_type cm(core.at(index));
336  if (!cm)
337  throw std::logic_error("CoreMetadata null");
338  return *cm;
339  }
340 
341  public:
342  // Documented in superclass.
343  const std::set<MetadataOptions::MetadataLevel>&
345 
346  // Documented in superclass.
347  void
348  setMetadataOptions(const MetadataOptions& options);
349 
350  // Documented in superclass.
351  const MetadataOptions&
352  getMetadataOptions() const;
353 
356 
357  // Documented in superclass.
358  const MetadataMap&
359  getGlobalMetadata() const;
360 
361  // Documented in superclass.
363  getMetadataValue(const std::string& field) const;
364 
365  // Documented in superclass.
366  const MetadataMap&
367  getSeriesMetadata() const;
368 
369  // Documented in superclass.
371  getSeriesMetadataValue(const MetadataMap::key_type& field) const;
372 
373  // Documented in superclass.
374  bool
375  isThisType(const boost::filesystem::path& name,
376  bool open = true) const;
377 
378  // Documented in superclass.
379  bool
380  isThisType(const uint8_t *begin,
381  std::size_t length) const;
382 
383  // Documented in superclass.
384  bool
385  isThisType(const uint8_t *begin,
386  const uint8_t *end) const;
387 
388  // Documented in superclass.
389  bool
390  isThisType(std::istream& stream) const;
391 
392  protected:
405  virtual
406  bool
407  isFilenameThisTypeImpl(const boost::filesystem::path& name) const;
408 
421  virtual
422  bool
423  isStreamThisTypeImpl(std::istream& stream) const;
424 
425  public:
426  // Documented in superclass.
428  getImageCount() const;
429 
430  // Documented in superclass.
431  bool
432  isRGB() const;
433 
434  // Documented in superclass.
436  getSizeX() const;
437 
438  // Documented in superclass.
440  getSizeY() const;
441 
442  // Documented in superclass.
444  getSizeZ() const;
445 
446  // Documented in superclass.
448  getSizeT() const;
449 
450  // Documented in superclass.
452  getSizeC() const;
453 
454  // Documented in superclass.
456  getPixelType() const;
457 
458  // Documented in superclass.
460  getBitsPerPixel() const;
461 
462  // Documented in superclass.
464  getEffectiveSizeC() const;
465 
466  // Documented in superclass.
468  getRGBChannelCount() const;
469 
470  // Documented in superclass.
471  bool
472  isIndexed() const;
473 
474  // Documented in superclass.
475  bool
476  isFalseColor() const;
477 
478  // Documented in superclass.
479  void
481  dimension_size_type no) const;
482 
483  // Documented in superclass.
484  Modulo&
485  getModuloZ();
486 
487  // Documented in superclass.
488  const Modulo&
489  getModuloZ() const;
490 
491  // Documented in superclass.
492  Modulo&
493  getModuloT();
494 
495  // Documented in superclass.
496  const Modulo&
497  getModuloT() const;
498 
499  // Documented in superclass.
500  Modulo&
501  getModuloC();
502 
503  // Documented in superclass.
504  const Modulo&
505  getModuloC() const;
506 
507  protected:
514  ome::compat::array<dimension_size_type, 2>
515  getThumbSize() const;
516 
517  public:
518  // Documented in superclass.
520  getThumbSizeX() const;
521 
522  // Documented in superclass.
524  getThumbSizeY() const;
525 
526  // Documented in superclass.
527  bool
528  isLittleEndian() const;
529 
530  // Documented in superclass.
531  const std::string&
532  getDimensionOrder() const;
533 
534  // Documented in superclass.
535  bool
536  isOrderCertain() const;
537 
538  // Documented in superclass.
539  bool
540  isThumbnailSeries() const;
541 
542  // Documented in superclass.
543  bool
544  isInterleaved() const;
545 
546  // Documented in superclass.
547  bool
549 
550  // Documented in superclass.
551  void
553  VariantPixelBuffer& buf) const;
554 
555  // Documented in superclass.
556  void
558  VariantPixelBuffer& buf,
562  dimension_size_type h) const;
563 
564  protected:
568  virtual
569  void
571  VariantPixelBuffer& buf,
575  dimension_size_type h) const = 0;
576 
577  public:
578  // Documented in superclass.
579  void
581  VariantPixelBuffer& buf) const;
582 
583  // Documented in superclass.
584  void
585  close(bool fileOnly = false);
586 
587  // Documented in superclass.
589  getSeriesCount() const;
590 
591  // Documented in superclass.
592  void
593  setSeries(dimension_size_type no) const;
594 
595  // Documented in superclass.
597  getSeries() const;
598 
599  // Documented in superclass.
600  void
601  setGroupFiles(bool group);
602 
603  // Documented in superclass.
604  bool
605  isGroupFiles() const;
606 
607  // Documented in superclass.
609  fileGroupOption(const std::string& id);
610 
611  // Documented in superclass.
612  bool
613  isMetadataComplete() const;
614 
615  // Documented in superclass.
616  void
617  setNormalized(bool normalize);
618 
619  // Documented in superclass.
620  bool
621  isNormalized() const;
622 
623  // Documented in superclass.
624  void
625  setOriginalMetadataPopulated(bool populate);
626 
627  // Documented in superclass.
628  bool
630 
631  // Documented in superclass.
632  const std::vector<boost::filesystem::path>
633  getUsedFiles(bool noPixels = false) const;
634 
635  // Documented in superclass.
636  const std::vector<boost::filesystem::path>
637  getSeriesUsedFiles(bool noPixels = false) const;
638 
639  // Documented in superclass.
640  std::vector<FileInfo>
641  getAdvancedUsedFiles(bool noPixels = false) const;
642 
643  // Documented in superclass.
644  std::vector<FileInfo>
645  getAdvancedSeriesUsedFiles(bool noPixels = false) const;
646 
647  // Documented in superclass.
648  const boost::optional<boost::filesystem::path>&
649  getCurrentFile() const;
650 
651  // Documented in superclass.
655  dimension_size_type t) const;
656 
657  // Documented in superclass.
662  dimension_size_type moduloZ,
663  dimension_size_type moduloC,
664  dimension_size_type moduloT) const;
665 
666  // Documented in superclass.
667  ome::compat::array<dimension_size_type, 3>
668  getZCTCoords(dimension_size_type index) const;
669 
670  // Documented in superclass.
671  ome::compat::array<dimension_size_type, 6>
673 
674  // Documented in superclass.
675  const std::vector<ome::compat::shared_ptr< ::ome::bioformats::CoreMetadata> >&
676  getCoreMetadataList() const;
677 
678  // Documented in superclass.
679  void
680  setMetadataFiltered(bool filter);
681 
682  // Documented in superclass.
683  bool
684  isMetadataFiltered() const;
685 
686  // Documented in superclass.
687  void
688  setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>& store);
689 
690  // Documented in superclass.
691  const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
692  getMetadataStore() const;
693 
694  // Documented in superclass.
695  ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>&
697 
698  // Documented in superclass.
699  std::vector<ome::compat::shared_ptr< ::ome::bioformats::FormatReader> >
700  getUnderlyingReaders() const;
701 
702  // Documented in superclass.
703  bool
704  isSingleFile(const boost::filesystem::path& id) const;
705 
706  // Documented in superclass.
707  uint32_t
708  getRequiredDirectories(const std::vector<std::string>& files) const;
709 
710  // Documented in superclass.
711  const std::string&
713 
714  // Documented in superclass.
715  const std::vector<std::string>&
716  getPossibleDomains(const std::string& id) const;
717 
718  // Documented in superclass.
719  bool
720  hasCompanionFiles() const;
721 
722  // Documented in superclass.
723  const std::vector<std::string>&
724  getDomains() const;
725 
726  // Documented in superclass.
728  getOptimalTileWidth() const;
729 
730  // Documented in superclass.
732  getOptimalTileHeight() const;
733 
734  // Documented in superclass.
737 
738  // Documented in superclass.
741 
742  // Documented in superclass.
744  getCoreIndex() const;
745 
746  // Documented in superclass.
747  void
748  setCoreIndex(dimension_size_type index) const;
749 
750  // Documented in superclass.
752  getResolutionCount() const;
753 
754  // Documented in superclass.
755  void
756  setResolution(dimension_size_type resolution) const;
757 
758  // Documented in superclass.
760  getResolution() const;
761 
762  // Documented in superclass.
763  bool
764  hasFlattenedResolutions() const;
765 
766  // Documented in superclass.
767  void
768  setFlattenedResolutions(bool flatten);
769 
770  // Documented in superclass.
771  void
772  setId(const boost::filesystem::path& id);
773 
774  // Documented in superclass.
775  const std::string&
776  getFormat() const;
777 
778  // Documented in superclass.
779  const std::string&
780  getFormatDescription() const;
781 
782  // Documented in superclass.
783  const std::vector<boost::filesystem::path>&
784  getSuffixes() const;
785 
786  // Documented in superclass.
787  const std::vector<boost::filesystem::path>&
788  getCompressionSuffixes() const;
789  };
790 
791  }
792  }
793 }
794 
795 #endif // OME_BIOFORMATS_DETAIL_FORMATREADER_H
796 
797 /*
798  * Local Variables:
799  * mode:C++
800  * End:
801  */
bool isLittleEndian() const
Get whether the data is in little-endian format.
Definition: FormatReader.cpp:695
bool isMetadataComplete() const
Get status of metadata parsing.
Definition: FormatReader.cpp:823
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:533
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:627
bool isSingleFile(const boost::filesystem::path &id) const
Is this a single-file format?
Definition: FormatReader.cpp:1085
const std::vector< boost::filesystem::path > getSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:875
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:716
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:817
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:942
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:639
void setCoreIndex(dimension_size_type index) const
Set the current resolution/series (ignoring subresolutions).
Definition: FormatReader.cpp:1296
const CoreMetadata & getCoreMetadata(dimension_size_type index) const
Get CoreMetadata by core index.
Definition: FormatReader.h:316
virtual void readPlane(std::istream &source, VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h)
Read a raw plane.
Definition: FormatReader.cpp:205
void setSeries(dimension_size_type no) const
Set the active series.
Definition: FormatReader.cpp:790
dimension_size_type seriesToCoreIndex(dimension_size_type series) const
Get the first core index corresponding to the specified series.
Definition: FormatReader.cpp:1138
dimension_size_type getResolution() const
Get the active resolution level.
Definition: FormatReader.cpp:1271
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:913
Interface for all biological file format readers.
Definition: FormatReader.h:70
dimension_size_type getRGBChannelCount() const
Get the number of channels returned with each call to openBytes().
Definition: FormatReader.cpp:570
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:995
void getLookupTable(VariantPixelBuffer &buf, dimension_size_type no) const
Get the color lookup table associated with an image plane.
Definition: FormatReader.cpp:596
bool companionFiles
Whether this format supports multi-file datasets.
Definition: FormatReader.h:172
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:983
std::vector< std::string > domains
List of domains in which this format is used.
Definition: FormatReader.h:193
void setGroupFiles(bool group)
Set file grouping.
Definition: FormatReader.cpp:804
void setMetadataFiltered(bool filter)
Set metadata filtering.
Definition: FormatReader.cpp:1043
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:1056
pixel_size_type getBitsPerPixel() const
Get the number of valid bits per pixel.
Definition: FormatReader.cpp:540
std::vector< ome::compat::shared_ptr< ::ome::bioformats::FormatReader > > getUnderlyingReaders() const
Get all underlying readers.
Definition: FormatReader.cpp:1079
void setId(const boost::filesystem::path &id)
Set the current file name.
Definition: FormatReader.cpp:1310
::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:856
void setNormalized(bool normalize)
Set float normalization.
Definition: FormatReader.cpp:830
FormatReader()
Constructor.
Definition: FormatReader.h:136
dimension_size_type getSeriesCount() const
Get the number of image series in this file.
Definition: FormatReader.cpp:779
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:1283
void setOriginalMetadataPopulated(bool populate)
Specifies whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.cpp:843
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:766
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:77
bool isInterleaved() const
Get whether or not the channels are interleaved.
Definition: FormatReader.cpp:723
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:1036
bool isNormalized() const
Get float normalization.
Definition: FormatReader.cpp:837
std::string key_type
Key type.
Definition: MetadataMap.h:147
CoreMetadata & getCoreMetadata(dimension_size_type index)
Get CoreMetadata by core index.
Definition: FormatReader.h:333
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:1196
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:1010
bool isOrderCertain() const
Get whether the dimension order and sizes are known, or merely guesses.
Definition: FormatReader.cpp:709
const MetadataMap::value_type & getSeriesMetadataValue(const MetadataMap::key_type &field) const
Get a series metadata value.
Definition: FormatReader.cpp:1016
const std::string & getDimensionOrder() const
Get the dimension order.
Definition: FormatReader.cpp:702
dimension_size_type getEffectiveSizeC() const
Get the effective size of the C dimension.
Definition: FormatReader.cpp:557
dimension_size_type getCoreIndex() const
Get the CoreMetadata index of the current resolution/series.
Definition: FormatReader.cpp:1290
std::vector< FileInfo > getAdvancedUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:884
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
virtual void openBytesImpl(dimension_size_type no, 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 file.
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
void openThumbBytes(dimension_size_type no, VariantPixelBuffer &buf) const
Obtain a thumbnail of an image plane.
Definition: FormatReader.cpp:754
bool isFalseColor() const
Get whether the image planes are false color.
Definition: FormatReader.cpp:589
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:1029
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:850
bool isIndexed() const
Get whether the image planes are indexed color.
Definition: FormatReader.cpp:582
dimension_size_type getOptimalTileHeight() const
Get the optimal sub-image height.
Definition: FormatReader.cpp:1129
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:1109
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:1103
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:948
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:603
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:1115
const MetadataMap & getGlobalMetadata() const
Get global metadata map.
Definition: FormatReader.cpp:1023
dimension_size_type getThumbSizeX() const
Get the thumbnail size of the X dimension.
Definition: FormatReader.cpp:683
FormatReader & operator=(const FormatReader &)
Assignment operator (deleted).
dimension_size_type series
The number of the current series (non-flattened).
Definition: FormatReader.h:142
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:1122
void setResolution(dimension_size_type resolution) const
Set the active resolution level.
Definition: FormatReader.cpp:1257
Modulo & getModuloT()
Get the Modulo subdivision of the T dimension.
Definition: FormatReader.cpp:615
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:1091
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore() const
Get the current metadata store for this reader.
Definition: FormatReader.cpp:1067
dimension_size_type coreIndex
The number of the current series (flattened).
Definition: FormatReader.h:134
bool isRGB() const
Check if the image planes in the file have more than one channel per openBytes() call.
Definition: FormatReader.cpp:491
bool isGroupFiles() const
Get file grouping.
Definition: FormatReader.cpp:811
dimension_size_type getResolutionCount() const
Get the number of resolutions for the current series.
Definition: FormatReader.cpp:1245
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:1097
bool isMetadataFiltered() const
Get metadata filtering.
Definition: FormatReader.cpp:1050
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:798
bool hasFlattenedResolutions() const
Get resolution flattening.
Definition: FormatReader.cpp:1277
dimension_size_type getSizeX() const
Get the size of the X dimension.
Definition: FormatReader.cpp:498
void openBytes(dimension_size_type no, VariantPixelBuffer &buf) const
Obtain an image plane.
Definition: FormatReader.cpp:736
dimension_size_type getThumbSizeY() const
Get the thumbnail size of the Y dimension.
Definition: FormatReader.cpp:689
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