ome-files 0.1.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

FormatReader.h
1 /*
2 * #%L
3 * OME-FILES 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_FILES_DETAIL_FORMATREADER_H
39 #define OME_FILES_DETAIL_FORMATREADER_H
40
41 #include <string>
42 #include <vector>
43 #include <map>
44
45 #include <ome/files/FormatReader.h>
46 #include <ome/files/FormatHandler.h>
47
48 namespace ome
49 {
50 namespace files
51 {
58 namespace detail
59 {
60
64 struct ReaderProperties
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
107 class FormatReader : public ::ome::files::FormatReader,
108 virtual public ::ome::files::FormatHandler
109 {
110 protected:
112 typedef std::vector<ome::compat::shared_ptr< ::ome::files::CoreMetadata> > coremetadata_list_type;
113
115 const ReaderProperties& readerProperties;
116
118 boost::optional<boost::filesystem::path> currentId;
119
121 ome::compat::shared_ptr<std::istream> in;
122
124 ::ome::files::MetadataMap metadata;
125
132 mutable dimension_size_type coreIndex;
133
140 mutable dimension_size_type series;
141
148 mutable dimension_size_type plane;
149
151 coremetadata_list_type core;
152
159 mutable dimension_size_type resolution;
160
162 bool flattenedResolutions;
163
169 bool suffixNecessary;
170
175 bool suffixSufficient;
176
178 bool companionFiles;
179
181 std::string datasetDescription;
182
184 bool normalizeData;
185
187 bool filterMetadata;
188
190 bool saveOriginalMetadata;
191
193 bool indexedAsRGB;
194
196 bool group;
197
199 std::vector<std::string> domains;
200
205 ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore> metadataStore;
206
208 MetadataOptions metadataOptions;
209
211 FormatReader(const ReaderProperties&);
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,
273 dimension_size_type x,
274 dimension_size_type y,
275 dimension_size_type w,
276 dimension_size_type h,
277 dimension_size_type samples);
278
294 virtual
295 void
296 readPlane(std::istream& source,
297 VariantPixelBuffer& dest,
298 dimension_size_type x,
299 dimension_size_type y,
300 dimension_size_type w,
301 dimension_size_type h,
302 dimension_size_type scanlinePad,
303 dimension_size_type samples);
304
313 virtual
314 ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore>
315 makeFilterMetadata();
316
325 const CoreMetadata&
326 getCoreMetadata(dimension_size_type index) const
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&
343 getCoreMetadata(dimension_size_type index)
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>&
354 getSupportedMetadataLevels();
355
356 // Documented in superclass.
357 void
358 setMetadataOptions(const MetadataOptions& options);
359
360 // Documented in superclass.
361 const MetadataOptions&
362 getMetadataOptions() const;
363
364 MetadataOptions&
365 getMetadataOptions();
366
367 // Documented in superclass.
368 const MetadataMap&
369 getGlobalMetadata() const;
370
371 // Documented in superclass.
372 const MetadataMap::value_type&
373 getMetadataValue(const std::string& field) const;
374
375 // Documented in superclass.
376 const MetadataMap&
377 getSeriesMetadata() const;
378
379 // Documented in superclass.
380 const MetadataMap::value_type&
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.
437 dimension_size_type
438 getImageCount() const;
439
440 // Documented in superclass.
441 bool
442 isRGB(dimension_size_type channel) const;
443
444 // Documented in superclass.
445 dimension_size_type
446 getSizeX() const;
447
448 // Documented in superclass.
449 dimension_size_type
450 getSizeY() const;
451
452 // Documented in superclass.
453 dimension_size_type
454 getSizeZ() const;
455
456 // Documented in superclass.
457 dimension_size_type
458 getSizeT() const;
459
460 // Documented in superclass.
461 dimension_size_type
462 getSizeC() const;
463
464 // Documented in superclass.
465 ome::xml::model::enums::PixelType
466 getPixelType() const;
467
468 // Documented in superclass.
469 pixel_size_type
470 getBitsPerPixel() const;
471
472 // Documented in superclass.
473 dimension_size_type
474 getEffectiveSizeC() const;
475
476 // Documented in superclass.
477 dimension_size_type
478 getRGBChannelCount(dimension_size_type channel) const;
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
490 getLookupTable(dimension_size_type plane,
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.
529 dimension_size_type
530 getThumbSizeX() const;
531
532 // Documented in superclass.
533 dimension_size_type
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
558 isInterleaved(dimension_size_type subC) const;
559
560 // Documented in superclass.
561 void
562 openBytes(dimension_size_type plane,
563 VariantPixelBuffer& buf) const;
564
565 // Documented in superclass.
566 void
567 openBytes(dimension_size_type plane,
568 VariantPixelBuffer& buf,
569 dimension_size_type x,
570 dimension_size_type y,
571 dimension_size_type w,
572 dimension_size_type h) const;
573
574 protected:
578 virtual
579 void
580 openBytesImpl(dimension_size_type plane,
581 VariantPixelBuffer& buf,
582 dimension_size_type x,
583 dimension_size_type y,
584 dimension_size_type w,
585 dimension_size_type h) const = 0;
586
587 public:
588 // Documented in superclass.
589 void
590 openThumbBytes(dimension_size_type plane,
591 VariantPixelBuffer& buf) const;
592
593 // Documented in superclass.
594 void
595 close(bool fileOnly = false);
596
597 // Documented in superclass.
598 dimension_size_type
599 getSeriesCount() const;
600
601 // Documented in superclass.
602 void
603 setSeries(dimension_size_type series) const;
604
605 // Documented in superclass.
606 dimension_size_type
607 getSeries() const;
608
609 // Documented in superclass.
610 void
611 setPlane(dimension_size_type plane) const;
612
613 // Documented in superclass.
614 dimension_size_type
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.
626 FileGroupOption
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
647 isOriginalMetadataPopulated() const;
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.
670 dimension_size_type
671 getIndex(dimension_size_type z,
672 dimension_size_type c,
673 dimension_size_type t) const;
674
675 // Documented in superclass.
676 dimension_size_type
677 getIndex(dimension_size_type z,
678 dimension_size_type c,
679 dimension_size_type t,
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>
690 getZCTModuloCoords(dimension_size_type index) const;
691
692 // Documented in superclass.
693 const std::vector<ome::compat::shared_ptr< ::ome::files::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>&
714 getMetadataStore();
715
716 // Documented in superclass.
717 std::vector<ome::compat::shared_ptr< ::ome::files::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&
730 getDatasetStructureDescription() const;
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.
745 dimension_size_type
746 getOptimalTileWidth(dimension_size_type channel) const;
747
748 // Documented in superclass.
749 dimension_size_type
750 getOptimalTileHeight(dimension_size_type channel) const;
751
752 // Documented in superclass.
753 dimension_size_type
754 getOptimalTileWidth() const;
755
756 // Documented in superclass.
757 dimension_size_type
758 getOptimalTileHeight() const;
759
760 // Documented in superclass.
761 dimension_size_type
762 seriesToCoreIndex(dimension_size_type series) const;
763
764 // Documented in superclass.
765 dimension_size_type
766 coreIndexToSeries(dimension_size_type index) const;
767
768 // Documented in superclass.
769 dimension_size_type
770 getCoreIndex() const;
771
772 // Documented in superclass.
773 void
774 setCoreIndex(dimension_size_type index) const;
775
776 // Documented in superclass.
777 dimension_size_type
778 getResolutionCount() const;
779
780 // Documented in superclass.
781 void
782 setResolution(dimension_size_type resolution) const;
783
784 // Documented in superclass.
785 dimension_size_type
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_FILES_DETAIL_FORMATREADER_H
822
823 /*
824 * Local Variables:
825 * mode:C++
826 * End:
827 */
ome::files::detail::FormatReader::getAdvancedUsedFiles
std::vector< FileInfo > getAdvancedUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:902
ome::files::detail::FormatReader::indexedAsRGB
bool indexedAsRGB
Whether or not MetadataStore sets C = 3 for indexed color images.
Definition: FormatReader.h:193
ome::files::detail::FormatReader::resolution
dimension_size_type resolution
The number of the current resolution.
Definition: FormatReader.h:159
ome::files::detail::ReaderProperties
Properties specific to a particular reader.
Definition: FormatReader.h:64
ome::files::detail::FormatReader::readerProperties
const ReaderProperties & readerProperties
Reader properties specific to the derived file format.
Definition: FormatReader.h:115
ome::files::detail::FormatReader::seriesToCoreIndex
dimension_size_type seriesToCoreIndex(dimension_size_type series) const
Get the first core index corresponding to the specified series.
Definition: FormatReader.cpp:1185
ome::files::detail::FormatReader::isNormalized
bool isNormalized() const
Get float normalization.
Definition: FormatReader.cpp:855
ome::files::detail::FormatReader::setPlane
void setPlane(dimension_size_type plane) const
Set the active plane.
Definition: FormatReader.cpp:799
ome::files::detail::FormatReader::isMetadataFiltered
bool isMetadataFiltered() const
Get metadata filtering.
Definition: FormatReader.cpp:1068
ome::files::detail::FormatReader::getCompressionSuffixes
const std::vector< boost::filesystem::path > & getCompressionSuffixes() const
Get the default compression suffixes for this file format.
Definition: FormatReader.cpp:130
ome::files::detail::FormatReader::getResolution
dimension_size_type getResolution() const
Get the active resolution level.
Definition: FormatReader.cpp:1319
ome::files::detail::FormatReader::fileGroupOption
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
ome::files::detail::FormatReader::isRGB
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
ome::files::pixel_size_type
uint32_t pixel_size_type
Size type for pixel bit depths.
Definition: Types.h:62
ome::files::detail::FormatReader::getRGBChannelCount
dimension_size_type getRGBChannelCount(dimension_size_type channel) const
Get the number of channels returned for a call to openBytes().
Definition: FormatReader.cpp:567
ome::files::detail::FormatReader::in
ome::compat::shared_ptr< std::istream > in
Current input.
Definition: FormatReader.h:121
ome::files::detail::FormatReader::setGroupFiles
void setGroupFiles(bool group)
Set file grouping.
Definition: FormatReader.cpp:822
ome::files::detail::FormatReader::getAdvancedSeriesUsedFiles
std::vector< FileInfo > getAdvancedSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:931
ome::files::detail::FormatReader::isMetadataComplete
bool isMetadataComplete() const
Get status of metadata parsing.
Definition: FormatReader.cpp:841
ome::files::dimension_size_type
std::size_t dimension_size_type
Size type for image dimensions.
Definition: Types.h:59
ome::files::detail::FormatReader::getModuloC
Modulo & getModuloC()
Get the Modulo subdivision of the C dimension.
Definition: FormatReader.cpp:620
ome::files::detail::FormatReader::getSuffixes
const std::vector< boost::filesystem::path > & getSuffixes() const
Get the default file suffixes for this file format.
Definition: FormatReader.cpp:124
ome::files::detail::FormatReader::getLookupTable
void getLookupTable(dimension_size_type plane, VariantPixelBuffer &buf) const
Get the color lookup table associated with an image plane.
Definition: FormatReader.cpp:587
ome::files::detail::ReaderProperties::metadata_levels
std::set< MetadataOptions::MetadataLevel > metadata_levels
Supported metadata levels. A typical default is {METADATA_MINIMUM,METADATA_NO_OVERLAYS,METADATA_ALL}.
Definition: FormatReader.h:75
ome::files::detail::FormatReader::domains
std::vector< std::string > domains
List of domains in which this format is used.
Definition: FormatReader.h:199
ome::files::MetadataMap::value_type
boost::make_variant_over< discriminated_types >::type value_type
Value type, allowing assignment of all storable types.
Definition: MetadataMap.h:147
ome::files::FormatReader::FileGroupOption
FileGroupOption
File grouping options.
Definition: FormatReader.h:77
ome::files::detail::FormatReader::isIndexed
bool isIndexed() const
Get whether the image planes are indexed color.
Definition: FormatReader.cpp:573
ome::files::detail::FormatReader::getDatasetStructureDescription
const std::string & getDatasetStructureDescription() const
Get a short description of the dataset structure.
Definition: FormatReader.cpp:1115
ome::files::MetadataMap
Metadata key-value map using a restricted set of value types.
Definition: MetadataMap.h:79
ome::files::detail::FormatReader::getCoreIndex
dimension_size_type getCoreIndex() const
Get the CoreMetadata index of the current resolution/series.
Definition: FormatReader.cpp:1338
ome::files::detail::FormatReader::series
dimension_size_type series
The number of the current series (non-flattened).
Definition: FormatReader.h:140
ome::files::detail::FormatReader::setNormalized
void setNormalized(bool normalize)
Set float normalization.
Definition: FormatReader.cpp:848
ome::files::detail::FormatReader::readPlane
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
ome::files::detail::FormatReader::suffixNecessary
bool suffixNecessary
Whether the file extension matching one of the reader's suffixes is necessary to identify the file as...
Definition: FormatReader.h:169
ome::files::detail::FormatReader::metadata
::ome::files::MetadataMap metadata
Mapping of metadata key/value pairs.
Definition: FormatReader.h:124
ome::files::detail::FormatReader::getUsedFiles
const std::vector< boost::filesystem::path > getUsedFiles(bool noPixels=false) const
Get the files used by this dataset.
Definition: FormatReader.cpp:874
ome::files::detail::FormatReader::getOptimalTileWidth
dimension_size_type getOptimalTileWidth() const
Get the optimal sub-image width.
Definition: FormatReader.cpp:1159
ome::files::detail::FormatReader::filterMetadata
bool filterMetadata
Whether or not to filter out invalid metadata.
Definition: FormatReader.h:187
ome::files::detail::FormatReader::getCoreMetadataList
const std::vector< ome::compat::shared_ptr< ::ome::files::CoreMetadata > > & getCoreMetadataList() const
Get the core metadata.
Definition: FormatReader.cpp:1054
ome::files::detail::FormatReader::getSizeT
dimension_size_type getSizeT() const
Get the size of the T dimension.
Definition: FormatReader.cpp:520
ome::files::detail::FormatReader::isOrderCertain
bool isOrderCertain() const
Get whether the dimension order and sizes are known, or merely guesses.
Definition: FormatReader.cpp:702
ome::files::detail::FormatReader::getResolutionCount
dimension_size_type getResolutionCount() const
Get the number of resolutions for the current series.
Definition: FormatReader.cpp:1292
ome::files::detail::FormatReader::plane
dimension_size_type plane
The number of the current plane in the current series.
Definition: FormatReader.h:148
ome::files::detail::FormatReader::isThisType
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
ome::files::detail::FormatReader::operator=
FormatReader & operator=(const FormatReader &)
Assignment operator (deleted).
ome::files::detail::FormatReader::getMetadataOptions
const MetadataOptions & getMetadataOptions() const
Get metadata options.
Definition: FormatReader.cpp:408
ome::files::detail::FormatReader::getZCTCoords
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
ome::files::detail::FormatReader::setResolution
void setResolution(dimension_size_type resolution) const
Set the active resolution level.
Definition: FormatReader.cpp:1304
ome::files::detail::FormatReader::getThumbSizeX
dimension_size_type getThumbSizeX() const
Get the thumbnail size of the X dimension.
Definition: FormatReader.cpp:676
ome::files::detail::FormatReader::getSeriesMetadata
const MetadataMap & getSeriesMetadata() const
Get series metadata map.
Definition: FormatReader.cpp:1047
ome::files::detail::FormatReader::getSeriesUsedFiles
const std::vector< boost::filesystem::path > getSeriesUsedFiles(bool noPixels=false) const
Get the files used by the active series.
Definition: FormatReader.cpp:893
ome::files::detail::ReaderProperties::suffixes
std::vector< boost::filesystem::path > suffixes
Filename suffixes this format can handle.
Definition: FormatReader.h:71
ome::files::detail::FormatReader::isSingleFile
bool isSingleFile(const boost::filesystem::path &id) const
Is this a single-file format?
Definition: FormatReader.cpp:1103
ome::files::detail::FormatReader::isFilenameThisTypeImpl
virtual bool isFilenameThisTypeImpl(const boost::filesystem::path &name) const
isThisType file implementation for readers.
Definition: FormatReader.cpp:473
ome::files::detail::FormatReader::companionFiles
bool companionFiles
Whether this format supports multi-file datasets.
Definition: FormatReader.h:178
ome::files::detail::ReaderProperties::name
std::string name
Format name.
Definition: FormatReader.h:67
ome
ome::files::detail::FormatReader::flattenedResolutions
bool flattenedResolutions
Whether or not resolutions are flattened.
Definition: FormatReader.h:162
ome::files::detail::FormatReader::group
bool group
Whether or not to group multi-file formats.
Definition: FormatReader.h:196
ome::files::detail::FormatReader::saveOriginalMetadata
bool saveOriginalMetadata
Whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.h:190
ome::files::detail::FormatReader::getCoreMetadata
const CoreMetadata & getCoreMetadata(dimension_size_type index) const
Get CoreMetadata by core index.
Definition: FormatReader.h:326
ome::files::detail::FormatReader::isGroupFiles
bool isGroupFiles() const
Get file grouping.
Definition: FormatReader.cpp:829
ome::files::detail::FormatReader::openBytes
void openBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain an image plane.
Definition: FormatReader.cpp:729
ome::files::detail::FormatReader::getModuloT
Modulo & getModuloT()
Get the Modulo subdivision of the T dimension.
Definition: FormatReader.cpp:608
ome::files::detail::FormatReader::openThumbBytes
void openThumbBytes(dimension_size_type plane, VariantPixelBuffer &buf) const
Obtain a thumbnail of an image plane.
Definition: FormatReader.cpp:748
ome::files::detail::FormatReader::isOriginalMetadataPopulated
bool isOriginalMetadataPopulated() const
Get proprietary metadata storage.
Definition: FormatReader.cpp:868
ome::files::detail::FormatReader::coremetadata_list_type
std::vector< ome::compat::shared_ptr< ::ome::files::CoreMetadata > > coremetadata_list_type
List type for storing CoreMetadata.
Definition: FormatReader.h:112
ome::files::detail::FormatReader::getUnderlyingReaders
std::vector< ome::compat::shared_ptr< ::ome::files::FormatReader > > getUnderlyingReaders() const
Get all underlying readers.
Definition: FormatReader.cpp:1097
ome::files::detail::FormatReader::setId
void setId(const boost::filesystem::path &id)
Set the current file name.
Definition: FormatReader.cpp:1359
ome::files::detail::FormatReader::initFile
virtual void initFile(const boost::filesystem::path &id)
Initialize the given file.
Definition: FormatReader.cpp:142
ome::files::detail::FormatReader::normalizeData
bool normalizeData
Whether or not to normalize float data.
Definition: FormatReader.h:184
ome::files::detail::FormatReader::getCoreMetadata
CoreMetadata & getCoreMetadata(dimension_size_type index)
Get CoreMetadata by core index.
Definition: FormatReader.h:343
ome::files::MetadataMap::key_type
std::string key_type
Key type.
Definition: MetadataMap.h:144
ome::files::CoreMetadata
Core metadata values.
Definition: CoreMetadata.h:78
ome::files::detail::FormatReader::getSeriesCount
dimension_size_type getSeriesCount() const
Get the number of image series in this file.
Definition: FormatReader.cpp:773
ome::files::detail::FormatReader::setOriginalMetadataPopulated
void setOriginalMetadataPopulated(bool populate)
Specifies whether or not to save proprietary metadata in the MetadataStore.
Definition: FormatReader.cpp:861
ome::files::detail::FormatReader::setFlattenedResolutions
void setFlattenedResolutions(bool flatten)
Set resolution flattening.
Definition: FormatReader.cpp:1331
ome::files::detail::FormatReader::setCoreIndex
void setCoreIndex(dimension_size_type index) const
Set the current resolution/series (ignoring sub-resolutions).
Definition: FormatReader.cpp:1344
ome::files::detail::FormatReader::hasFlattenedResolutions
bool hasFlattenedResolutions() const
Get resolution flattening.
Definition: FormatReader.cpp:1325
ome::files::detail::FormatReader::isInterleaved
bool isInterleaved() const
Get whether or not the channels are interleaved.
Definition: FormatReader.cpp:716
ome::files::detail::FormatReader::getDimensionOrder
const std::string & getDimensionOrder() const
Get the dimension order.
Definition: FormatReader.cpp:695
ome::files::detail::FormatReader::getSizeY
dimension_size_type getSizeY() const
Get the size of the Y dimension.
Definition: FormatReader.cpp:506
ome::files::detail::FormatReader::core
coremetadata_list_type core
Core metadata values.
Definition: FormatReader.h:151
ome::files::detail::FormatReader::getIndex
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
ome::files::detail::FormatReader::getPossibleDomains
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
ome::files::detail::FormatReader::getModuloZ
Modulo & getModuloZ()
Get the Modulo subdivision of the Z dimension.
Definition: FormatReader.cpp:596
ome::files::detail::FormatReader::suffixSufficient
bool suffixSufficient
Whether the file extension matching one of the reader's suffixes is sufficient to identify the file a...
Definition: FormatReader.h:175
ome::files::detail::FormatReader::getThumbSizeY
dimension_size_type getThumbSizeY() const
Get the thumbnail size of the Y dimension.
Definition: FormatReader.cpp:682
ome::files::detail::FormatReader::isLittleEndian
bool isLittleEndian() const
Get whether the data is in little-endian format.
Definition: FormatReader.cpp:688
ome::files::detail::FormatReader::metadataOptions
MetadataOptions metadataOptions
Metadata parsing options.
Definition: FormatReader.h:208
ome::files::detail::FormatReader::getSizeZ
dimension_size_type getSizeZ() const
Get the size of the Z dimension.
Definition: FormatReader.cpp:513
ome::files::detail::FormatReader::getMetadataStore
const ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > & getMetadataStore() const
Get the current metadata store for this reader.
Definition: FormatReader.cpp:1085
ome::files::detail::FormatReader::getRequiredDirectories
uint32_t getRequiredDirectories(const std::vector< std::string > &files) const
Get required parent directories.
Definition: FormatReader.cpp:1109
ome::files::detail::FormatReader::getThumbSize
ome::compat::array< dimension_size_type, 2 > getThumbSize() const
Get the thumbnail size of the X and Y dimensions.
Definition: FormatReader.cpp:632
ome::files::detail::FormatReader::getSizeC
dimension_size_type getSizeC() const
Get the size of the C dimension.
Definition: FormatReader.cpp:527
ome::files::detail::FormatReader
Interface for all biological file format readers (default behaviour).
Definition: FormatReader.h:107
ome::files::detail::FormatReader::getImageCount
dimension_size_type getImageCount() const
Determine the number of image planes in the current series.
Definition: FormatReader.cpp:485
ome::files::detail::FormatReader::getGlobalMetadata
const MetadataMap & getGlobalMetadata() const
Get global metadata map.
Definition: FormatReader.cpp:1041
ome::files::detail::FormatReader::getSeries
dimension_size_type getSeries() const
Get the active series.
Definition: FormatReader.cpp:793
ome::files::detail::FormatReader::getPixelType
ome::xml::model::enums::PixelType getPixelType() const
Get the pixel type.
Definition: FormatReader.cpp:537
ome::files::detail::ReaderProperties::description
std::string description
Format description.
Definition: FormatReader.h:69
ome::files::detail::FormatReader::getBitsPerPixel
pixel_size_type getBitsPerPixel() const
Get the number of valid bits per pixel.
Definition: FormatReader.cpp:544
ome::xml::model::enums::PixelType
ome::files::detail::FormatReader::getDomains
const std::vector< std::string > & getDomains() const
Get the domains represented by the current file.
Definition: FormatReader.cpp:1133
ome::files::detail::FormatReader::hasCompanionFiles
bool hasCompanionFiles() const
Does this format support multi-file datasets?
Definition: FormatReader.cpp:1121
ome::files::detail::ReaderProperties::compression_suffixes
std::vector< boost::filesystem::path > compression_suffixes
Filename compression suffixes this format can handle.
Definition: FormatReader.h:73
ome::files::detail::FormatReader::currentId
boost::optional< boost::filesystem::path > currentId
The identifier (path) of the currently open file.
Definition: FormatReader.h:118
ome::files::detail::FormatReader::isThumbnailSeries
bool isThumbnailSeries() const
Get whether the current series is a lower resolution copy of a different series.
Definition: FormatReader.cpp:709
ome::files::detail::FormatReader::datasetDescription
std::string datasetDescription
Short description of the structure of the dataset.
Definition: FormatReader.h:181
ome::files::detail::FormatReader::isStreamThisTypeImpl
virtual bool isStreamThisTypeImpl(std::istream &stream) const
isThisType stream implementation for readers.
Definition: FormatReader.cpp:479
ome::files::detail::FormatReader::setSeries
void setSeries(dimension_size_type series) const
Set the active series.
Definition: FormatReader.cpp:784
ome::files::detail::FormatReader::openBytesImpl
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.
ome::files::FormatReader
Interface for all biological file format readers.
Definition: FormatReader.h:70
ome::files::detail::FormatReader::getMetadataValue
const MetadataMap::value_type & getMetadataValue(const std::string &field) const
Get a global metadata value.
Definition: FormatReader.cpp:1028
ome::files::detail::FormatReader::isFalseColor
bool isFalseColor() const
Get whether the image planes are false color.
Definition: FormatReader.cpp:580
ome::files::detail::FormatReader::getFormat
const std::string & getFormat() const
Get the name of this file format.
Definition: FormatReader.cpp:112
ome::files::detail::FormatReader::getCurrentFile
const boost::optional< boost::filesystem::path > & getCurrentFile() const
Get the currently open file.
Definition: FormatReader.cpp:960
ome::files::detail::FormatReader::setMetadataFiltered
void setMetadataFiltered(bool filter)
Set metadata filtering.
Definition: FormatReader.cpp:1061
ome::files::Modulo
A subdimension of Z, C, or T.
Definition: Modulo.h:57
ome::files::detail::FormatReader::setMetadataStore
void setMetadataStore(ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > &store)
Set the default metadata store for this reader.
Definition: FormatReader.cpp:1074
ome::files::detail::FormatReader::~FormatReader
virtual ~FormatReader()
Destructor.
Definition: FormatReader.cpp:107
ome::files::detail::FormatReader::makeFilterMetadata
virtual ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > makeFilterMetadata()
Create a configured FilterMetadata instance.
Definition: FormatReader.cpp:393
ome::files::detail::FormatReader::getSeriesMetadataValue
const MetadataMap::value_type & getSeriesMetadataValue(const MetadataMap::key_type &field) const
Get a series metadata value.
Definition: FormatReader.cpp:1034
ome::files::detail::FormatReader::getZCTModuloCoords
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
ome::files::detail::FormatReader::setMetadataOptions
void setMetadataOptions(const MetadataOptions &options)
Set metadata options.
Definition: FormatReader.cpp:402
ome::files::detail::FormatReader::getFormatDescription
const std::string & getFormatDescription() const
Get the description of this file format.
Definition: FormatReader.cpp:118
ome::files::detail::FormatReader::getOptimalTileHeight
dimension_size_type getOptimalTileHeight() const
Get the optimal sub-image height.
Definition: FormatReader.cpp:1172
ome::files::detail::FormatReader::isUsedFile
virtual bool isUsedFile(const boost::filesystem::path &file)
Check if a file is in the used files list.
Definition: FormatReader.cpp:170
ome::files::detail::FormatReader::coreIndexToSeries
dimension_size_type coreIndexToSeries(dimension_size_type index) const
Get the series corresponding to the specified core index.
Definition: FormatReader.cpp:1243
ome::files::detail::ReaderProperties::ReaderProperties
ReaderProperties(const std::string &name, const std::string &description)
Constructor.
Definition: FormatReader.h:83
ome::files::detail::FormatReader::getPlane
dimension_size_type getPlane() const
Get the active plane.
Definition: FormatReader.cpp:814
ome::files::VariantPixelBuffer
Buffer for all pixel types.
Definition: VariantPixelBuffer.h:75
ome::files::detail::FormatReader::getEffectiveSizeC
dimension_size_type getEffectiveSizeC() const
Get the effective size of the C dimension.
Definition: FormatReader.cpp:561
ome::files::detail::FormatReader::coreIndex
dimension_size_type coreIndex
The number of the current series (flattened).
Definition: FormatReader.h:132
ome::files::FormatHandler
Interface for all biological file format readers and writers.
Definition: FormatHandler.h:64
ome::files::FormatReader::FormatReader
FormatReader()
Constructor.
Definition: FormatReader.h:141
ome::files::detail::FormatReader::getSizeX
dimension_size_type getSizeX() const
Get the size of the X dimension.
Definition: FormatReader.cpp:499
ome::files::detail::FormatReader::getSupportedMetadataLevels
const std::set< MetadataOptions::MetadataLevel > & getSupportedMetadataLevels()
Get the supported metadata levels.
Definition: FormatReader.cpp:136
ome::files::MetadataOptions
Metadata options.
Definition: MetadataOptions.h:55
ome::files::detail::FormatReader::close
void close(bool fileOnly=false)
Close the currently open file.
Definition: FormatReader.cpp:760
ome::files::detail::FormatReader::metadataStore
ome::compat::shared_ptr< ::ome::xml::meta::MetadataStore > metadataStore
Current metadata store.
Definition: FormatReader.h:205