@@ -477,7 +477,12 @@ INSERT INTO `ImagingFileTypes` (type, description) VALUES
477477 (' txt' , ' text file' ),
478478 (' nii' , ' NIfTI file' ),
479479 (' nrrd' , ' NRRD file format (used by DTIPrep)' ),
480- (' grid_0' , ' MNI BIC non-linear field for non-linear transformation' );
480+ (' grid_0' , ' MNI BIC non-linear field for non-linear transformation' ),
481+ (' json' , ' JSON file' ),
482+ (' readme' , ' README file' ),
483+ (' tsv' , ' Tab separated values (TSV) file' ),
484+ (' bval' , ' NIfTI DWI file with b-values' ),
485+ (' bvec' , ' NIfTI DWI file with b-vectors' );
481486
482487CREATE TABLE `mri_processing_protocol ` (
483488 ` ProcessProtocolID` int (11 ) unsigned NOT NULL AUTO_INCREMENT,
@@ -797,18 +802,34 @@ INSERT INTO `bids_scan_type` (BIDSScanType) VALUES
797802 (' T2w' ),
798803 (' dwi' );
799804
805+ CREATE TABLE `bids_phase_encoding_direction ` (
806+ ` BIDSPhaseEncodingDirectionID` int (3 ) unsigned NOT NULL AUTO_INCREMENT,
807+ ` BIDSPhaseEncodingDirectionName` varchar (3 ) NOT NULL ,
808+ PRIMARY KEY (` BIDSPhaseEncodingDirectionID` )
809+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8;
810+
811+ INSERT INTO bids_phase_encoding_direction (BIDSPhaseEncodingDirectionName) VALUES
812+ (' i' ),
813+ (' i-' ),
814+ (' j' ),
815+ (' j-' ),
816+ (' k' ),
817+ (' k-' );
818+
800819CREATE TABLE `bids_mri_scan_type_rel ` (
801- ` MRIScanTypeID` int (10 ) UNSIGNED NOT NULL ,
802- ` BIDSCategoryID` int (3 ) UNSIGNED DEFAULT NULL ,
803- ` BIDSScanTypeSubCategoryID` int (3 ) UNSIGNED DEFAULT NULL ,
804- ` BIDSScanTypeID` int (3 ) UNSIGNED DEFAULT NULL ,
805- ` BIDSEchoNumber` int (3 ) UNSIGNED DEFAULT NULL ,
820+ ` MRIScanTypeID` int (10 ) UNSIGNED NOT NULL ,
821+ ` BIDSCategoryID` int (3 ) UNSIGNED DEFAULT NULL ,
822+ ` BIDSScanTypeSubCategoryID` int (3 ) UNSIGNED DEFAULT NULL ,
823+ ` BIDSScanTypeID` int (3 ) UNSIGNED DEFAULT NULL ,
824+ ` BIDSEchoNumber` int (3 ) UNSIGNED DEFAULT NULL ,
825+ ` BIDSPhaseEncodingDirectionID` int (3 ) UNSIGNED DEFAULT NULL ,
806826 PRIMARY KEY (` MRIScanTypeID` ),
807827 KEY ` FK_bids_mri_scan_type_rel` (` MRIScanTypeID` ),
808- CONSTRAINT ` FK_bids_mri_scan_type_rel` FOREIGN KEY (` MRIScanTypeID` ) REFERENCES ` mri_scan_type` (` ID` ) ON DELETE CASCADE ON UPDATE CASCADE,
809- CONSTRAINT ` FK_bids_category` FOREIGN KEY (` BIDSCategoryID` ) REFERENCES ` bids_category` (` BIDSCategoryID` ),
810- CONSTRAINT ` FK_bids_scan_type_subcategory` FOREIGN KEY (` BIDSScanTypeSubCategoryID` ) REFERENCES ` bids_scan_type_subcategory` (` BIDSScanTypeSubCategoryID` ),
811- CONSTRAINT ` FK_bids_scan_type` FOREIGN KEY (` BIDSScanTypeID` ) REFERENCES ` bids_scan_type` (` BIDSScanTypeID` )
828+ CONSTRAINT ` FK_bids_mri_scan_type_rel` FOREIGN KEY (` MRIScanTypeID` ) REFERENCES ` mri_scan_type` (` ID` ) ON DELETE CASCADE ON UPDATE CASCADE,
829+ CONSTRAINT ` FK_bids_category` FOREIGN KEY (` BIDSCategoryID` ) REFERENCES ` bids_category` (` BIDSCategoryID` ),
830+ CONSTRAINT ` FK_bids_scan_type_subcategory` FOREIGN KEY (` BIDSScanTypeSubCategoryID` ) REFERENCES ` bids_scan_type_subcategory` (` BIDSScanTypeSubCategoryID` ),
831+ CONSTRAINT ` FK_bids_scan_type` FOREIGN KEY (` BIDSScanTypeID` ) REFERENCES ` bids_scan_type` (` BIDSScanTypeID` ),
832+ CONSTRAINT ` FK_bids_phase_encoding_direction` FOREIGN KEY (` BIDSPhaseEncodingDirectionID` ) REFERENCES ` bids_phase_encoding_direction` (` BIDSPhaseEncodingDirectionID` )
812833) ENGINE= InnoDB DEFAULT CHARSET= utf8;
813834
814835
@@ -852,6 +873,50 @@ INSERT INTO bids_mri_scan_type_rel
852873 NULL
853874 );
854875
876+
877+ CREATE TABLE `bids_export_file_level_category ` (
878+ ` BIDSExportFileLevelCategoryID` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
879+ ` BIDSExportFileLevelCategoryName` varchar (12 ) NOT NULL ,
880+ PRIMARY KEY (` BIDSExportFileLevelCategoryID` )
881+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8;
882+
883+ INSERT INTO bids_export_file_level_category (BIDSExportFileLevelCategoryName) VALUES
884+ (' study' ),
885+ (' image' ),
886+ (' session' );
887+
888+ CREATE TABLE `bids_export_non_imaging_file_category ` (
889+ ` BIDSNonImagingFileCategoryID` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
890+ ` BIDSNonImagingFileCategoryName` varchar (40 ) NOT NULL ,
891+ PRIMARY KEY (` BIDSNonImagingFileCategoryID` )
892+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8;
893+
894+ INSERT INTO bids_export_non_imaging_file_category (BIDSNonImagingFileCategoryName) VALUES
895+ (' dataset_description' ),
896+ (' README' ),
897+ (' bids-validator-config' ),
898+ (' participants_list_file' ),
899+ (' session_list_of_scans' );
900+
901+ CREATE TABLE `bids_export_files ` (
902+ ` BIDSExportedFileID` int (10 ) unsigned NOT NULL AUTO_INCREMENT,
903+ ` BIDSExportFileLevelCategoryID` int (10 ) unsigned NOT NULL ,
904+ ` FileID` int (10 ) unsigned DEFAULT NULL ,
905+ ` SessionID` int (10 ) unsigned DEFAULT NULL ,
906+ ` BIDSNonImagingFileCategoryID` int (10 ) unsigned DEFAULT NULL ,
907+ ` BIDSCategoryID` int (3 ) unsigned DEFAULT NULL ,
908+ ` FileType` varchar (12 ) NOT NULL ,
909+ ` FilePath` varchar (255 ) NOT NULL ,
910+ PRIMARY KEY (` BIDSExportedFileID` ),
911+ CONSTRAINT ` FK_bef_BIDSExportFileLevelID` FOREIGN KEY (` BIDSExportFileLevelCategoryID` ) REFERENCES ` bids_export_file_level_category` (` BIDSExportFileLevelCategoryID` ),
912+ CONSTRAINT ` FK_bef_FileID` FOREIGN KEY (` FileID` ) REFERENCES ` files` (` FileID` ),
913+ CONSTRAINT ` FK_bef_SessionID` FOREIGN KEY (` SessionID` ) REFERENCES ` session` (` ID` ),
914+ CONSTRAINT ` FK_bef_BIDSNonImagingFileCategoryID` FOREIGN KEY (` BIDSNonImagingFileCategoryID` ) REFERENCES ` bids_export_non_imaging_file_category` (` BIDSNonImagingFileCategoryID` ),
915+ CONSTRAINT ` FK_bef_ModalityType` FOREIGN KEY (` BIDSCategoryID` ) REFERENCES ` bids_category` (` BIDSCategoryID` ),
916+ CONSTRAINT ` FK_bef_FileType` FOREIGN KEY (` FileType` ) REFERENCES ` ImagingFileTypes` (` type` )
917+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8;
918+
919+
855920-- ********************************
856921-- MRI violations tables
857922-- ********************************
0 commit comments