Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 1. Install dependencies only when needed
FROM node:18-alpine AS deps
FROM node:20-alpine AS deps

WORKDIR /app

Expand Down Expand Up @@ -35,6 +35,7 @@ COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/next.config.ts ./

# Expose the port Next.js runs on
EXPOSE 3000
Expand Down
14 changes: 14 additions & 0 deletions apps/frontend/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
experimental: {
serverActions: {
bodySizeLimit: '100mb',
},
},

async rewrites() {
return [
{
source: '/api/:path*',
destination: 'http://backend:8000/api/:path*' // Routes traffic safely inside the Docker network
}
];
}
};

export default nextConfig;
21 changes: 15 additions & 6 deletions apps/frontend/src/app/_home/UploadButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import { cn } from "@/lib/utils";
import { UploadDataType, UploadModalityType } from "@/enums";
import { Upload as UploadIcon } from "lucide-react";
import { useAppContext } from "@/providers/AppProvider";
import { findNiftiFile, findRelevantFiles } from "@/utils";
import { getReport } from "@/services/apiReport";
import { toast } from "sonner";
import { useRouter } from "next/navigation";
import { IAllRelevantFilesType } from "@/types";
import { handleBidsUpload, handleDicomUpload } from "./uploadHandlers";

type TUploadDataOptions = (typeof UploadDataType)[keyof typeof UploadDataType];
Expand Down Expand Up @@ -62,7 +59,7 @@ const UploadButtons = () => {
setApiData(data);
if (
data.missing_required_parameters &&
data.missing_required_parameters.length > 0
Number(data.missing_required_parameters.length) > 0
) {
toast.info(
"Report generated with missing parameters. Please provide the missing values."
Expand Down Expand Up @@ -91,7 +88,7 @@ const UploadButtons = () => {
<Button
type="button"
className={cn(
"rounded-l-md rounded-r-none border border-input cursor-pointer",
"rounded-l-md rounded-r-none border border-input cursor-pointer z-10",
activeModalityTypeOption === UploadModalityType.ASL
? "bg-primary text-primary-foreground"
: "bg-background text-foreground hover:bg-accent hover:text-accent-foreground"
Expand All @@ -103,7 +100,19 @@ const UploadButtons = () => {
<Button
type="button"
className={cn(
"rounded-r-md rounded-l-none border-t border-b border-r border-input -ml-px cursor-pointer",
"rounded-none border-t border-b border-r border-input -ml-px cursor-pointer z-10",
activeModalityTypeOption === UploadModalityType.DSC
? "bg-primary text-primary-foreground"
: "bg-background text-foreground hover:bg-accent hover:text-accent-foreground"
)}
onClick={() => setActiveModalityTypeOption(UploadModalityType.DSC)}
>
DSC
</Button>
<Button
type="button"
className={cn(
"rounded-r-md rounded-l-none border-t border-b border-r border-input -ml-px cursor-pointer z-10",
activeModalityTypeOption === UploadModalityType.DCE
? "bg-primary text-primary-foreground"
: "bg-background text-foreground hover:bg-accent hover:text-accent-foreground"
Expand Down
2 changes: 2 additions & 0 deletions apps/frontend/src/app/_home/uploadHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const handleBidsUpload = async ({
files: FileList;
setIsLoading: (v: boolean) => void;
setUploadedFiles: (files: IAllRelevantFilesType) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setUploadConfig: (config: any) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setUpdatedJsonContent: (content: any) => void;
setUpdatedJsonFilename: (filename: string) => void;
activeModalityTypeOption: UploadModalityType;
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/enums/UploadModalityType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
enum UploadModalityType {
ASL = 'ASL',
DSC = 'DSC',
DCE = 'DCE',
}

Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/services/apiReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import {IReportApiResponse} from '@/types';


const API_BASE_URL = `${process.env.NEXT_PUBLIC_API_BASE_URL}/report`;
const API_BASE_URL = `/api/report`;

const client = axios.create({
baseURL: API_BASE_URL,
Expand Down
4 changes: 4 additions & 0 deletions package/src/pyaslreport/modalities/dce/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .processor import DCEProcessor
from .validator import DCEValidator

__all__ = ["DCEProcessor", "DCEValidator"]
22 changes: 22 additions & 0 deletions package/src/pyaslreport/modalities/dce/processor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pyaslreport.modalities.base_processor import BaseProcessor
from pyaslreport.modalities.dce.validator import DCEValidator

class DCEProcessor(BaseProcessor):
"""
Processor for Dynamic Contrast-Enhanced (DCE) MRI modality.
Phase 2 GSoC Implementation.
"""
def __init__(self):
super().__init__()
self.validator = DCEValidator()

def process(self, data):
# Phase 2 Stub for DCE processing logic
print("Processing DCE data... (Phase 2 Stub)")

# TODO: Implement DCE-specific metadata extraction and normalization
# 1. Parse DCE DICOM tags
# 2. Extract contrast agent timing
# 3. Map to BIDS DCE extension schema

return {"modality": "DCE", "status": "stubbed", "data": "dce data"}
15 changes: 15 additions & 0 deletions package/src/pyaslreport/modalities/dce/validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from pyaslreport.modalities.base_validator import BaseValidator

class DCEValidator(BaseValidator):
"""
Validator for Dynamic Contrast-Enhanced (DCE) MRI modality.
Phase 2 GSoC Implementation.
"""
def validate(self, data):
# Phase 2 Stub for DCE validation logic
print("Validating DCE data... (Phase 2 Stub)")

# TODO: Implement DCE-specific validation rules
# e.g., Check for ContrastBolusVolume, RepetitionTime, etc.

return True