Skip to content

Commit fc98e29

Browse files
committed
feat: include base path context in AI prompt for accurate BIDS conversion scripts
1 parent 3d60707 commit fc98e29

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/components/User/Dashboard/DatasetOrganizer/LLMPanel.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,21 @@ const LLMPanel: React.FC<LLMPanelProps> = ({
183183
const fileSummary = buildFileSummary(null);
184184
const prompt = `You are a neuroimaging data expert. Analyze the following file structure and metadata from a neuroimaging dataset and generate a Python script to convert it to BIDS format.
185185
186+
BASE DIRECTORY PATH: ${baseDirectoryPath}
187+
186188
FILE STRUCTURE AND METADATA:
187189
${fileSummary}
188190
189-
all _sourcePath are relative to the root path ${baseDirectoryPath}
191+
IMPORTANT: All file paths shown above are RELATIVE paths. The actual files are located in the base directory: ${baseDirectoryPath}
192+
For example, if you see "test.zip/sub-01/scan.nii", the full path is: ${baseDirectoryPath}/test.zip/sub-01/scan.nii
190193
191194
Please generate a Python script that:
192-
1. Reads the source files
193-
2. Renames and reorganizes them according to BIDS specification
194-
3. Creates required BIDS metadata files (dataset_description.json, participants.tsv, etc.)
195-
4. Handles the specific file types present (NIfTI, SNIRF, JSON sidecars, etc.)
195+
1. Uses the base directory path: ${baseDirectoryPath}
196+
2. Reads the source files by combining base path + relative paths
197+
3. Reads the source files
198+
4. Renames and reorganizes them according to BIDS specification
199+
5. Creates required BIDS metadata files (dataset_description.json, participants.tsv, etc.)
200+
6. Handles the specific file types present (NIfTI, SNIRF, JSON sidecars, etc.)
196201
197202
Include comments explaining the BIDS structure.
198203
Output ONLY the Python script.`;

0 commit comments

Comments
 (0)