Skip to content

Commit

Permalink
Merge pull request #7 from ntraut/master
Browse files Browse the repository at this point in the history
Makefile + small fix
  • Loading branch information
r03ert0 authored Feb 15, 2018
2 parents ac16293 + 209e605 commit fb1d9c5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CC=gcc
CFLAGS=-Wall
LDFLAGS=-lm
EXEC=volume

all: $(EXEC)

volume: main.o Analyze.o MGH.o Nifti.o
$(CC) $(LDFLAGS) main.o Analyze.o MGH.o Nifti.o -o volume

main.o: main.c
$(CC) $(CFLAGS) -c main.c

Analyze.o: Analyze.c
$(CC) $(CFLAGS) -c Analyze.c

MGH.o: MGH.c
$(CC) $(CFLAGS) -c MGH.c

Nifti.o: Nifti.c
$(CC) $(CFLAGS) -c Nifti.c

clean:
rm -rf *.o

mrproper: clean
rm -rf $(EXEC)
7 changes: 4 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2559,6 +2559,7 @@ int saveMaskedVolume_Text(char *path, char *maskpath){
AnalyzeHeader *mask_hdr;
char *mask_img;
int mask_dim[4];
int i, j, k;

loadVolume(maskpath,&mask_hdr,&mask_img);
mask_dim[0]=mask_hdr->dim[1];
Expand All @@ -2571,9 +2572,9 @@ int saveMaskedVolume_Text(char *path, char *maskpath){

printf("volume: min:%f max:%f \n",min(),max());

for(int i=0;i<dim[0];i++)
for(int j=0;j<dim[1];j++)
for(int k=0;k<dim[2];k++){
for(i=0;i<dim[0];i++)
for(j=0;j<dim[1];j++)
for(k=0;k<dim[2];k++){
int mask_i = k*mask_dim[1]*mask_dim[0]+j*mask_dim[0]+i;
if (getValue2(mask_i,mask_hdr, mask_img)!=0 ){ //masking
fprintf(f, "%f ",getValue(i, j, k));
Expand Down

0 comments on commit fb1d9c5

Please sign in to comment.